You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Hearty <he...@gmail.com> on 2008/11/05 09:41:21 UTC
How to configure slf4j with apache geronimo
I am using apache geronimo. When I've tried to deploy my application (war
file) and try to run the application my logs are not creating under the
specified location.
I am using slf4j internally. The following jar files are specified under
web-inf/lib location of my application.
slf4j-api-1.5.0.jar,slf4j-log4j12-1.4.3.jar,log4j-1.2.14.jar.
I have put logging.properties under web-inf/lib as well as web-inf/classes
folders
My logging.properties is as follows
log4j.rootLogger=INFO, logFile
log4j.appender.logFile=org.apache.log4j.RollingFileAppender
log4j.appender.logFile.File=C:/tmp/logs/fp.log
log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
log4j.appender.logFile.layout.ConversionPattern=%d{dd/MM/yy HH:mm:ss} %-5p
[%t] %c{2} - %m%n
log4j.appender.logFile.MaxFileSize=1000KB
The logs are not creating under the location mentioned in
logging.properties. I am also hiding the jar files in geronimo-web.xml using
<hidden-classes> tag [which avoid the loading classes from the parent class
loader]
I am getting the following warning message in server console
log4j:WARN No appenders could be found for logger
(org.springframework.web.conte
xt.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
Please advise how to fix this issue.
Thanks in advance
--
View this message in context: http://www.nabble.com/How-to-configure-slf4j-with-apache-geronimo-tp20337877s134p20337877.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: How to configure slf4j with apache geronimo
Posted by Hearty <he...@gmail.com>.
I am looking for application specific logging.
I have specified as follows in geronimo-web.xml
<gbean name="DirectoryLog4jConfiguration"
class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean">
<attribute name="log4jResource">fp-log4j.properties</attribute>
</gbean>
where fp-log4j.properties is available under WEB-INF/classes folder of
deployed application war file.
But I am getting the following error
start of focalpoint/fp/1.0/war failed
org.apache.geronimo.kernel.config.LifecycleException: start of
focalpoint/fp/1.0/war failed
at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:579)
at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:543)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832)
at
org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
at
org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
at
org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
at
org.apache.geronimo.gbean.GBeanLifecycle$$EnhancerByCGLIB$$382e6bd0.startConfiguration(<generated>)
at
org.apache.geronimo.deployment.plugin.local.RedeployCommand.redeploySameConfiguration(RedeployCommand.java:229)
at
org.apache.geronimo.deployment.plugin.local.RedeployCommand.run(RedeployCommand.java:101)
at java.lang.Thread.run(Thread.java:803)
Caused by: org.apache.geronimo.kernel.config.InvalidConfigException: Unknown
start exception
at
org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:522)
at
org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:188)
at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:562)
... 15 more
Caused by: org.apache.geronimo.gbean.InvalidConfigurationException:
Configuration focalpoint/fp/1.0/war failed to start due to the following
reasons:
The service
J2EEApplication=null,WebModule=focalpoint/fp/1.0/war,j2eeType=SystemLog,name=DirectoryLog4jConfiguration
did not start for an unknown reason
at
org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:485)
... 17 more
Please advise me where I went wrong
Juergen Weber wrote:
>
> One cannot configure slf4j, only the logging framework it uses. You don't
> need the jars you cited, they are provided by Geronimo.
> As for configuring log4j, its done by var/log/server-log4j.properties
>
> See my question in the posting "Logging-Framework for applications?" and
> the resulting discussion a few days ago.
>
>
>
> Hearty wrote:
>>
>> I am using apache geronimo. When I've tried to deploy my application (war
>> file) and try to run the application my logs are not creating under the
>> specified location.
>>
>> I am using slf4j internally. The following jar files are specified under
>> web-inf/lib location of my application.
>> slf4j-api-1.5.0.jar,slf4j-log4j12-1.4.3.jar,log4j-1.2.14.jar.
>> I have put logging.properties under web-inf/lib as well as
>> web-inf/classes folders
>>
>> My logging.properties is as follows
>>
>> log4j.rootLogger=INFO, logFile
>>
>> log4j.appender.logFile=org.apache.log4j.RollingFileAppender
>> log4j.appender.logFile.File=C:/tmp/logs/fp.log
>> log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
>> log4j.appender.logFile.layout.ConversionPattern=%d{dd/MM/yy HH:mm:ss}
>> %-5p [%t] %c{2} - %m%n
>> log4j.appender.logFile.MaxFileSize=1000KB
>>
>> The logs are not creating under the location mentioned in
>> logging.properties. I am also hiding the jar files in geronimo-web.xml
>> using <hidden-classes> tag [which avoid the loading classes from the
>> parent class loader]
>>
>>
>> I am getting the following warning message in server console
>>
>> log4j:WARN No appenders could be found for logger
>> (org.springframework.web.conte
>> xt.ContextLoader).
>> log4j:WARN Please initialize the log4j system properly.
>>
>> Please advise how to fix this issue.
>>
>> Thanks in advance
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-configure-slf4j-with-apache-geronimo-tp20337877s134p20355415.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
Re: How to configure slf4j with apache geronimo
Posted by Juergen Weber <we...@gmail.com>.
One cannot configure slf4j, only the logging framework it uses. You don't
need the jars you cited, they are provided by Geronimo.
As for configuring log4j, its done by var/log/server-log4j.properties
See my question in the posting "Logging-Framework for applications?" and the
resulting discussion a few days ago.
Hearty wrote:
>
> I am using apache geronimo. When I've tried to deploy my application (war
> file) and try to run the application my logs are not creating under the
> specified location.
>
> I am using slf4j internally. The following jar files are specified under
> web-inf/lib location of my application.
> slf4j-api-1.5.0.jar,slf4j-log4j12-1.4.3.jar,log4j-1.2.14.jar.
> I have put logging.properties under web-inf/lib as well as web-inf/classes
> folders
>
> My logging.properties is as follows
>
> log4j.rootLogger=INFO, logFile
>
> log4j.appender.logFile=org.apache.log4j.RollingFileAppender
> log4j.appender.logFile.File=C:/tmp/logs/fp.log
> log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
> log4j.appender.logFile.layout.ConversionPattern=%d{dd/MM/yy HH:mm:ss} %-5p
> [%t] %c{2} - %m%n
> log4j.appender.logFile.MaxFileSize=1000KB
>
> The logs are not creating under the location mentioned in
> logging.properties. I am also hiding the jar files in geronimo-web.xml
> using <hidden-classes> tag [which avoid the loading classes from the
> parent class loader]
>
>
> I am getting the following warning message in server console
>
> log4j:WARN No appenders could be found for logger
> (org.springframework.web.conte
> xt.ContextLoader).
> log4j:WARN Please initialize the log4j system properly.
>
> Please advise how to fix this issue.
>
> Thanks in advance
>
--
View this message in context: http://www.nabble.com/How-to-configure-slf4j-with-apache-geronimo-tp20337877s134p20351205.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.