Unable to write to database(sql server 2012) using log4j2

2017-12-20 Thread Gaurav
Hi, Getting the error: Unable to write to database AppenderLoggingException: Failed to commit transaction logging event or flushing buffer. Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: An error occurred while reading the value from the stream object. Error: "java.io.IOExcepti

Re: [log4j] providing sourcewith Message

2017-12-20 Thread Ralph Goers
I’m not sure I would be comfortable applying the patch this way. Have you run a clirr report on your changes? I am concerned that this could break customizations that users might have made. What is the reason SourceLocation had to be used instead of StackTraceElement? Ralph > On Dec 20, 2017,

Re: [log4j] providing sourcewith Message

2017-12-20 Thread Jeffrey Shaw
It looks like the location only ever gets the file name, because that's what StackTraceElement gives. So that's fine. I think I'm ready for a formal review. Should I create pull requests on github for https://github.com/shawjef3/logging-log4j2/tree/message-location and https://github.com/shawjef3/

Re: [log4j] providing sourcewith Message

2017-12-20 Thread Matt Sicker
I think that should be configurable in the layout options. On 20 December 2017 at 13:04, Dominik Psenner wrote: > Could a compile time environment variable like SrcRootDirectory do the job? > > On 20 Dec 2017 7:49 p.m., "Jeffrey Shaw" wrote: > > > I got it working using a custom ExtendedLogger

Re: [log4j] providing sourcewith Message

2017-12-20 Thread Dominik Psenner
Could a compile time environment variable like SrcRootDirectory do the job? On 20 Dec 2017 7:49 p.m., "Jeffrey Shaw" wrote: > I got it working using a custom ExtendedLogger instead of mocking. > > It looks like for file name, there are only two options. We can have the > file name, or the full p

Re: [log4j] providing sourcewith Message

2017-12-20 Thread Jeffrey Shaw
I got it working using a custom ExtendedLogger instead of mocking. It looks like for file name, there are only two options. We can have the file name, or the full path to the file. The path relative to the project root looks impossible to get, unless we look for magic names like "src". Any opinion

Re: [log4j] providing sourcewith Message

2017-12-20 Thread Matt Sicker
It's possible that macros and mocks don't work well together, though that's just a guess. On 20 December 2017 at 00:00, Jeff Shaw wrote: > I should add that manually testing it works. > > Sent from my phone > > > On Dec 20, 2017, at 12:45 AM, Jeffrey Shaw wrote: > > > > I added some tests for t