Comments (13)
I just want to clarify, the grid itself is simply trying to write some data to
a
file, and the file is read only which is why it is not working. However, the
part
that is bothering me is that Elmah is throwing an exception and not able to log
the
error. Above is the details. Thank you
Original comment by [email protected]
on 5 Nov 2007 at 1:16
from elmah.
Original comment by azizatif
on 5 Nov 2007 at 1:28
- Changed state: Accepted
- Added labels: Component-Persistence, Priority-High
- Removed labels: Priority-Medium
from elmah.
I think all that is needed is to clean/sanitize the data before logging it, but
I am
not sure exactly what function to call to do that. It's hard to reproduce this
error unless you are using this specific grid.
Original comment by [email protected]
on 5 Nov 2007 at 1:30
from elmah.
This problem occurs because some detail of the exception cannot be persisted
since
the characters in range 0x00 to 0x1F (except 0x09, 0x0A and 0x0D) are not legal
in
XML 1.0.
Original comment by azizatif
on 5 Nov 2007 at 1:33
from elmah.
Yes, that's the only way. Actually the XmlWriter.WriteString documentation is
incorrect:
http://msdn2.microsoft.com/en-us/library/system.xml.xmlwriter.writestring.aspx
It states, "Character values in the range 0x-0x1F (excluding white space
characters
0x9, 0xA, and 0xD) are replaced with numeric character entities (� through
�x1F)." However, this does not happen by default. By default, it throws an
exception. There is a way in .NET 2.0 to disable the character checking by
setting
XmlWriterSettings.CheckCharacters to false, but this does not make it legal XML
1.0.
As a result sanitization may be the only right approach here.
Original comment by azizatif
on 5 Nov 2007 at 1:36
from elmah.
On second thoughts, it looks like that it may be best to resort to
XmlWriterSettings.CheckCharacters for now in order to remain compatible with
.NET
1.x builds as well as error objects that have already been formatted and
persisted
based on the current behavior.
Original comment by azizatif
on 5 Nov 2007 at 2:25
- Changed title: Logging fails when error contains invalid characters for XML 1.0
- Changed state: Started
from elmah.
Are you saying Set CheckCharacters to false and check it in to the build?
Original comment by [email protected]
on 5 Nov 2007 at 3:40
from elmah.
> Are you saying Set CheckCharacters to false
> and check it in to the build?
Yes
Original comment by azizatif
on 5 Nov 2007 at 3:45
from elmah.
Fixed in r237.
Original comment by azizatif
on 5 Nov 2007 at 5:12
- Changed state: Fixed
from elmah.
You beat me to it, I was just about to email you with the fix.
Original comment by [email protected]
on 5 Nov 2007 at 6:06
from elmah.
I'm running Elmah 1.1.11517.2009 and am receiving this error when pulling up
elmah.axd. The error itself is being logged as this error is appearing in
"ELMAH_Error" (in my SQL DB).
'�', hexadecimal value 0x01, is an invalid character. Line 1, position 166.
If I manually hide some of the errors in ELMAH_Error (by changing the
Application), then elmah.axd works without error. The stacktrace shows that
the error is occurring in "Elmah.SqlErrorLog.ErrorsXmlToList()" -- looks like
on line 61 (sort of hard to tell as I'm reading the XML encoded error directly
in the DB).
I hid about 20 errors to get elmah.axd to work. Probably one of those errors
contains the offending character, but I'm not sure which one. I've been using
Elmah for this project for over a year without this problem. The error was
logged using Elmah, so I can only speculate a problem persists. Thanks.
Original comment by [email protected]
on 8 Jul 2011 at 3:30
from elmah.
Following up on my comment, I should say that I just upgraded this project from
ASP.NET 3.5 to ASP.NET 4.0 about 2 days ago. Maybe it's related to that?
Original comment by [email protected]
on 8 Jul 2011 at 3:31
from elmah.
Hi there!
Try upgrading to ELMAH v1.2
Cheers,
James
Original comment by jamesdriscoll71
on 8 Jul 2011 at 2:48
from elmah.
Related Issues (20)
- Add color and style to error stack trace HOT 2
- XmlException when error XML has been customized with new elements HOT 2
- Ability to include sessoin information in logs HOT 1
- PATCH: Allow remote access by subnet HOT 3
- MySQL Support HOT 1
- .NET 1.x builds fail due to SqlCompactErrorLog.cs HOT 3
- Error parsing characters HOT 1
- ReSharper Reporting Elmah Run-Time Error in Properly Working Web Site HOT 2
- Error Email report not able to send HOT 1
- Add error XML and JSON detail URL to the downloadable CSV HOT 1
- Production issues HOT 3
- MySqlErrorLog comments missing from sample web.config HOT 1
- PgsqlErrorLog entry is uncommented in sample web.config HOT 1
- Unhandled errors that kill w3p process need to be logged HOT 2
- Update SQL Compact 4 dependency to RTM version HOT 1
- MySqlErrorLog.cs HOT 4
- Performance Issue HOT 4
- Support viewing errors from multiple applications HOT 5
- ELMAH's package isn't strongly signed with a pfx or snk file. HOT 4
- Exception thrown when XmlErrorLog logdirectory does not exists and errors are listed by elmah.axd HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elmah.