Sai,

Sorry for the slow response.
First, please be aware that the team is fully focussed on log4j-2.0 and not
spending effort on log4j-1.2 any more... So you may want to look at
log4j-2.0 if you are thinking about creating custom components...

I understand you are having trouble converting your log4j.properties file
to a log4j.xml file. Can you raise a JIRA ticket and attach both the
original log4j.properties file and the failing log4j.xml file? I'll take a
look.

Remko


On Sat, Jan 25, 2014 at 12:45 AM, Saibabu Vallurupalli <
saibabu.vallurupa...@gmail.com> wrote:

> Hi,
>
> Seems like all of you are busy. Can some one guide me with the issue below?
>
> Appreciate your support.
>
> Thank you,
> Sai
>
>
> ---------- Forwarded message ----------
> From: Saibabu Vallurupalli <saibabu.vallurupa...@gmail.com>
> Date: Thu, Jan 23, 2014 at 10:29 AM
> Subject: Help with rewrite appender
> To: log4j-u...@logging.apache.org
>
>
> Hi Good morning.
>
> I am trying to implement Rewrite Appender logic and based on my other
> conversations I understood the way I am doing below, But still I am unable
> to control certain messages.
>
> My Policy class is:
> ***************
> @Override
>     public LoggingEvent rewrite(LoggingEvent source) {
>         String msgToInspect = source.getMessage().toString();
>         if (null != msgToInspect && msgToInspect.contains("///")) {
>             return null;
>         }
>
>         return new LoggingEvent(source.getFQNOfLoggerClass(),
>                 source.getLogger(), source.getTimeStamp(),
> source.getLevel(),
>                 source.getMessage(), source.getThreadName(),
>                 source.getThrowableInformation(), source.getNDC(),
>                 source.getLocationInformation(), source.getProperties());
>     }
> ***************
>
> My log4j.properties file I configured these lines:
> log4j.appender.rewrite = org.apache.log4j.rewrite.RewriteAppender
> log4j.appender.rewrite.appender-ref = R, C
> log4j.appender.rewrite.rewritePolicy =
> gov.hhs.fha.nhinc.log4j.policy.CONNECTLog4jRewritePolicy
>
> where R is RollingFileAppender and C is ConsoleAppender. Based on my logic
> above. I do not want to print the lines having /// slashes in the log
> message. But I am still seeing those log statements.
>
> Am I missing anything here? Please advise.
>
> Thank you,
> Sai
>
>

Reply via email to