I am migrating an web application from WLS(Weblogic Server) 6.1 to 9.1. In
the previous application the lo4j.xml contains this snippet
<appender name="developer"
class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="./config/btn/logs/btn_tst.txt"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<!-- <param name="maxFileSize" value="30MB"/>
<param name="maxBackupIndex" value="10"/> -->
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="[slf5s.start]%d{ABSOLUTE}[slf5s.DATE] %p[slf5s.PRIORITY]
%x[slf5s.NDC] %t[slf5s.THREAD] %c[slf5s.CATEGORY]%n%m[slf5s.MESSAGE]%n%n"/>
</layout>
</appender>
And the expression %x[slf5s.NDC] put the name of the user name in the log
output automatically. In the original source which is from 2002 I don't find
any line of code with MDC.put or NDC.put
I am wondering why this feature doesn't work any more.
Can you tell me the meaning of slf5s I can't anything what explain slf5s.
Regards
Richard Markham
-----Ursprüngliche Nachricht-----
Von: James Stauffer [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 7. Dezember 2006 19:24
An: Log4J Users List
Betreff: Re: slf5s.ndc
You probably want to set the username and session id with MDC.put and
then you can include them with %X{key} where key is the first
parameter that you passed to MDC.put.
On 12/7/06, R. Markham <[EMAIL PROTECTED]> wrote:
>
>
> Hi All.
>
>
>
> I am new in this forum. I have a web application. I am using Weblogic
server
> 9.1 as a application server. In the log messages I want to put the user
> name, so I can trace the usage of the system related to the user name. I
> think I must use the category %x[slf5s.ndc]
>
>
>
> Here is my log4j.xml
>
>
>
> <appender name="developer"
> class="org.apache.log4j.TimeSizeRollingFileAppender">
>
> <param name="File" value="./config/btn/logs/btn_prd.txt"/>
>
> <param name="DatePattern" value="'.'yyyy-MM-dd"/>
>
> <param name="maxFileSize" value="30MB"/>
>
> <param name="maxBackupIndex" value="40"/>
>
> <layout class="org.apache.log4j.PatternLayout">
>
> <param name="ConversionPattern"
> value="[slf5s.start]%d{ABSOLUTE}[slf5s.DATE] %p[slf5s.PRIORITY]
> %x[slf5s.NDC] %t[slf5s.THREAD]
%c[slf5s.CATEGORY]%n%m[slf5s.MESSAGE]%n%n"/>
>
> </layout>
>
> </appender>
>
>
>
> I am not clear how I can log the information I want to eg username or
> session id in the log file.
>
> TIA
>
>
>
> Regards
>
>
>
>
>
> Richard Markham
>
>
>
>
>
--
James Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]