logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R. Markham" <markha...@gmx.de>
Subject slf5s.ndc
Date Thu, 07 Dec 2006 15:52:59 GMT
 

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

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message