Use MDC.
In code set the value with MDC.put("GUID", value) and then you can use
%X{GUID} in your config file.

On 2/28/06, Extra Extra <[EMAIL PROTECTED]> wrote:
> HI
>   I want to add my custom conversion character in to log message.say GUID as 
> %S
>   for that i have extended 
> Logger,LoggerFactory,LoggingEvent,RollingFileAppender,
>   PatternLayout,PatternParser,PatternConverter,PropertyConfigurator.
>
>   My problem is i have few component which are using log4j and use property 
> file for configuration.but i have no code level access to those classes.
>   when i run my application it is not showing value for my custom attribute(i 
> have given some default values)
>   It is not giving me any kind of error.
>   what should i do   :- please guide me,
>   my property file looks like
>
>   log4j.rootLogger=DEBUG,ROOT
>   log4j.logger=org.apache.log4j.test.CustomLogger
>   log4j.appender.ROOT=org.apache.log4j.test.CustomRollingFileAppender
>   log4j.appender.ROOT.File=C:/PropTest.log
>   log4j.appender.ROOT.MaxFileSize=1000KB
>   log4j.appender.ROOT.layout=org.apache.log4j.test.CustomPatternLayout
>   log4j.appender.ROOT.layout.ConversionPattern=%n--------------------%nTime: 
> %d%nGUID: %S%nMessage: %m
>
>   %S is my custom character
>
>   thanks in advance
>
>
> ---------------------------------
> Brings words and photos together (easily) with
>  PhotoMail  - it's free and works with Yahoo! Mail.
>


--
James Stauffer
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]

Reply via email to