0

I can able to get a parameter[ PID] at my program , then put this parameter to context using MDC

  MDC::put( "pid", strProcessId);

And i can log process id by adding this to config

 <layout class="org.apache.log4j.PatternLayout">
    <param name="ConversionPattern" value="%X{pid} "/>
  </layout>

But i want to pass this parameter to the file name at config such as

 <param name="file" value="LogFile%X{pid}.log" />

But this does not work...Anyway to do this in log4cxx?

Novalis
  • 2,265
  • 6
  • 39
  • 63

1 Answers1

0

This feature is available in Logback logging framework: http://logback.qos.ch/

Param
  • 2,420
  • 1
  • 14
  • 10