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

 

Reply via email to