Comments (8)
Hi @lawrencejohnston,
I will look at it ASAP, in the past I removed the reference to loggingEvent.RenderedMessage
cause I saw no difference..
Maybe it's my fault.
will update you soon.
Thanks!!
By the way,
Are you sure you want to do this: loggingEvent.Fix = FixFlags.All
?
Consider that this has a performance hit, maybe FixFlags.Partial
will be enough for you :)
from log4stash-old.
Hi @urielha
Thanks!
I'll take a look at FixFlags.All vs FixFlags.Partial for my code. I'm using it to stop log4net from dynamically populating fields that I'm not setting explicitly in the event (like the thread name). It may be that as long as in my appenders I'm only using fields included in FixFlags.Partial that that would be fine.
from log4stash-old.
@lawrencejohnston ,
Are you using ILogger
from a reason? why don't you use the regular ILog
?
One more thing,
The object you are logging is of Exception
type? or it's just the LoggingEvent
?
I'm trying to build a test upon it so we can be sure we got the right behavior.
Thanks
from log4stash-old.
We're using ILogger
because it has a Log
method that accepts a LoggingEvent
(rather than just a string and exception). We need to use a LoggingEvent
because the data is coming from a remote system and already has TimeStamp/ThreadName/Exception (serialized to a string) information.
The object we're logging is a LoggingEvent
with the ExceptionString
property set. Something like this should work for your test:
var eventData = new LoggingEventData {
ExceptionString = "Any string" // Can make it look more like Exception.ToString() if you want, but any string will do
// Any other properties you want to test...
};
var loggingEvent = new LoggingEvent(eventData);
ILogger logger = ... // Get ILogger
logger.Log(loggingEvent)
from log4stash-old.
I'm little busy those days so I will look at it ASAP.
Thanks!
from log4stash-old.
Hi @lawrencejohnston,
It's taking me more time than I thought, but I think you can workaround this issue.
Try to insert the ExceptionString into a property of the loggingEvent:
var eventData = new LoggingEventData {
// ....
};
eventData.Properties["TheException"] = "Exception string";
var loggingEvent = new LoggingEvent(eventData);
ILogger logger = ... // Get ILogger
logger.Log(loggingEvent)
let me know if this worked for you.
And one question:
can you tell me how exactly you extract the ILogger? are you using ILog.Logger
member?
Best regards
from log4stash-old.
Yes, that's how we're getting an ILogger
.
That workaround seems like it would work, but for now we're using a local fork with the changes described in the first post. As soon as the issues we've encountered are fixed and released we'll switch back to the NuGet version.
from log4stash-old.
Fixed with commit 560676d
from log4stash-old.
Related Issues (14)
- cant setup HOT 3
- The operation has timed out HOT 3
- Configure multiple elastic nodes HOT 5
- Custom log4net values get submitted as { "Count": 1 } HOT 3
- dynamic indexname HOT 4
- Stopped working after upgrading Elastic to 2.2 HOT 2
- json message double encoding HOT 3
- Error with properties with same name HOT 7
- Documentation HOT 7
- Test against new Elastic version HOT 1
- ElasticSearchAppender does not handle property with null value HOT 4
- How do you pass in a Referrer Header? HOT 1
- Performance Improvements to ElasticClient HOT 7
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 log4stash-old.