struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norbert Harrer <nhar...@gmx.at>
Subject Re: Origin of struts log messages misleading
Date Sat, 18 Jul 2015 07:35:59 GMT
Thanks, Martin, for your reply.

But aren't you talking about my own logging messages? I was talking 
about the log messages from struts itself.

Kindest Regards,
Norbert.

On 18.07.2015 02:16, Martin Gainty wrote:
> Norbert:
> you can always dig out the class name e.g.
> logger.getClass().getName()
>
> OR implement log4j and configure log4j.xml thusly:
>
> <Configuration status="warn" name="MyApp" packages="">
>    <Appenders>
>      <File name="MyFile" fileName="logs/app.log">
>        <PatternLayout>
>          <Pattern>%2 %d %p %c{1.} [%t] %m%n</Pattern>
>        </PatternLayout>
>      </File>
> ....
> </Appenders>
> </Configuration>
>
> Pattern of %2 is your class name
> http://logging.apache.org/log4j/2.x/faq.html
>
> best regards,
> Martin
>
>
>
>> To: user@struts.apache.org
>> From: nharrer@gmx.at
>> Subject: Origin of struts log messages misleading
>> Date: Fri, 17 Jul 2015 23:57:36 +0200
>>
>> Hi.
>>
>> I noticed, that all log messages from struts look like this:
>>
>> Jul 17, 2015 11:31:39 PM
>> com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
>> INFO: Parsing configuration file [struts-plugin.xml]
>> Jul 17, 2015 11:31:39 PM
>> com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
>> INFO: Parsing configuration file [struts.xml]
>> Jul 17, 2015 11:31:39 PM
>> com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
>> INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory)
>>
>> They are all coming from the logging wrapper
>> com.opensymphony.xwork2.util.logging.jdk.JdkLogger.
>>
>> While this is true, wouldn't it be much more helpful if the log would
>> show the actual class that made the logger call?
>> Sometimes it's helpful to examine the source code of struts classes
>> where log messages come from. But that way it's very hard to find out
>> where the log message actually originated from.
>>
>> I am using:
>> struts-2.3.24
>> tomcat-7.0.61
>>
>> Thanks and regards,
>> Norbert.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>   		 	   		


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message