You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by strutstwouser <st...@gmail.com> on 2009/10/13 15:44:19 UTC
log4j xml format to log4j.properties help
Hi,
I'm trying to suppress verbose logs from a Struts2 application. The Wiki
(http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-Reduceverboselogging)
says to add :
<category name="com.opensymphony.xwork2.ognl.OgnlValueStack">
<priority value="error"/>
</category>
to log4j.xml
However, our system uses log4j.properties files, so i tried to do the same
as :
log4j.rootCategory=off
log4j.category.com.opensymphony.xwork2.ognl.OgnlValueStack=off, xwork
log4j.appender.xwork=org.apache.log4j.ConsoleAppender
log4j.appender.xwork.layout=com.abc.logging.impl.Log4JPatternLayout
log4j.appender.xwork.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ}
%-5p %c{1} - %m%n
This does not show any change in behavior and the logs still appear.
I see some examples that start with log4j.rootLogger= instead of
log4j.rootCategory= . Does that matter ? . Am i missing something ?
Thanks,
s2user
--
View this message in context: http://www.nabble.com/log4j-xml-format-to-log4j.properties-help-tp25873162p25873162.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
RE: log4j xml format to log4j.properties help
Posted by strutstwouser <st...@gmail.com>.
Matt,
It was an email formatting error ; the first line just has :
log4j.category.com.opensymphony.xwork2.ognl.OgnlValueStack=off
Now, if i change to :
log4j.logger.com.opensymphony.xwork2.ognl.OgnlValueStack=ERROR , should i
also have :
log4j.rootLogger=off (instead of log4j.rootCategory=off) ?
Also, which appender will this logger use, since rootLogger is off -
shouldn't i define an appender A1 as well, like :
log4j.logger.com.opensymphony.xwork2.ognl.OgnlValueStack=ERROR , A1
I dont have access to the source right now, will try this tomorrow and see
how it goes..
Thanks!
Matt Brown wrote:
>
> Looking at the source, it appears that PropertyConfigurator supports both
> "log4j.category" or "log4j.logger" interchangably, as well as
> "log4j.rootCategory" and "log4j.rootLogger".
>
> Do you really mean for this to be all on one line or is it an email
> formatting error?
>
> log4j.category.com.opensymphony.xwork2.ognl.OgnlValueStack=off, xwork
> log4j.appender.xwork=org.apache.log4j.ConsoleAppender
>
>
> I would try:
>
> log4j.logger.com.opensymphony.xwork2.ognl.OgnlValueStack = ERROR
>
> And to be safe, you can kill all opensymphony logging as well:
>
> Log4j.logger.com.opensymphony.xwork2 = ERROR
>
--
View this message in context: http://www.nabble.com/log4j-xml-format-to-log4j.properties-help-tp25873162p25877736.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
RE: log4j xml format to log4j.properties help
Posted by Matt Brown <Ma...@citrixOnline.com>.
Looking at the source, it appears that PropertyConfigurator supports both "log4j.category" or "log4j.logger" interchangably, as well as "log4j.rootCategory" and "log4j.rootLogger".
Do you really mean for this to be all on one line or is it an email formatting error?
log4j.category.com.opensymphony.xwork2.ognl.OgnlValueStack=off, xwork log4j.appender.xwork=org.apache.log4j.ConsoleAppender
I would try:
log4j.logger.com.opensymphony.xwork2.ognl.OgnlValueStack = ERROR
And to be safe, you can kill all opensymphony logging as well:
Log4j.logger.com.opensymphony.xwork2 = ERROR
-----Original Message-----
From: strutstwouser [mailto:strutstwouser@gmail.com]
Sent: Tuesday, October 13, 2009 9:44 AM
To: log4j-user@logging.apache.org
Subject: log4j xml format to log4j.properties help
Hi,
I'm trying to suppress verbose logs from a Struts2 application. The Wiki
(http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html#TroubleshootingguidemigratingfromStruts2.0.xto2.1.x-Reduceverboselogging)
says to add :
<category name="com.opensymphony.xwork2.ognl.OgnlValueStack">
<priority value="error"/>
</category>
to log4j.xml
However, our system uses log4j.properties files, so i tried to do the same as :
log4j.rootCategory=off
log4j.category.com.opensymphony.xwork2.ognl.OgnlValueStack=off, xwork log4j.appender.xwork=org.apache.log4j.ConsoleAppender
log4j.appender.xwork.layout=com.abc.logging.impl.Log4JPatternLayout
log4j.appender.xwork.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ}
%-5p %c{1} - %m%n
This does not show any change in behavior and the logs still appear.
I see some examples that start with log4j.rootLogger= instead of log4j.rootCategory= . Does that matter ? . Am i missing something ?
Thanks,
s2user
--
View this message in context: http://www.nabble.com/log4j-xml-format-to-log4j.properties-help-tp25873162p25873162.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org