You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by lvdpal <lv...@lunaris-informatica.nl> on 2009/07/09 13:59:59 UTC

Re: log4jResource setting in GBean: ApplicationLog4jConfigurationGBean

I'm trying to do the same thing, but so far my application didn't have a
deployment plan yet. Now I'm trying to add one, so I can add the GBean, but
it's still not logging the way I want to. Any idea what I might be doing
wrong? (I have of course put the properties file in the specified
directory.)

<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
xmlns:pers="http://java.sun.com/xml/ns/persistence">
<context-root>Lunaboek</context-root>

<gbean name="DirectoryLog4jConfiguration"
class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean">
<attribute name="log4jFile">var/lunaboek/log4j.properties</attribute>
<reference name="ServerInfo"><name>ServerInfo</name></reference>
</gbean>
</web-app>
-- 
View this message in context: http://www.nabble.com/log4jResource-setting-in-GBean%3A-ApplicationLog4jConfigurationGBean-tp23936783s134p24408861.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: log4jResource setting in GBean: ApplicationLog4jConfigurationGBean

Posted by "viola.lu" <vi...@gmail.com>.
Can you attach your application here and your geronimo server version?
thanks. 

lvdpal wrote:
> 
> I'm trying to do the same thing, but so far my application didn't have a
> deployment plan yet. Now I'm trying to add one, so I can add the GBean,
> but it's still not logging the way I want to. Any idea what I might be
> doing wrong? (I have of course put the properties file in the specified
> directory.)
> 
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
> xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
> xmlns:name="http://geronimo.apache.org/xml/ns/naming-1.2"
> xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
> xmlns:pers="http://java.sun.com/xml/ns/persistence">
> <context-root>Lunaboek</context-root>
> 
> <gbean name="DirectoryLog4jConfiguration"
> class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean">
> <attribute name="log4jFile">var/lunaboek/log4j.properties</attribute>
> <reference name="ServerInfo"><name>ServerInfo</name></reference>
> </gbean>
> </web-app>
> 

-- 
View this message in context: http://www.nabble.com/log4jResource-setting-in-GBean%3A-ApplicationLog4jConfigurationGBean-tp23936783s134p24420060.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: log4jResource setting in GBean: ApplicationLog4jConfigurationGBean

Posted by Kevan Miller <ke...@gmail.com>.
On Jul 10, 2009, at 2:43 AM, lvdpal wrote:

>
> Well attaching the whole application might be a bit overwhelming.

Thank You!!! ;-)

Viola,
I'd really we rather not request attachments (especially potentially  
large attachments) on our mailing lists. Would prefer that we either  
use Jira (Attach file) or other file sharing mechanisms...

--kevan


Re: log4jResource setting in GBean: ApplicationLog4jConfigurationGBean

Posted by lvdpal <lv...@lunaris-informatica.nl>.
Well attaching the whole application might be a bit overwhelming. It's a
multi-module Maven project. I'm using an aspectJ library to weave in the
logging code into several of my modules. This is working, because I am
seeing the logging, only it is logging in geronimo.log and based on my
log4j.properties I'm expecting it to log into a logfile of my own.

My Geronimo version is 2.1.4 based on Jetty.

This is my log4j.properties file:

# Set root logger level to DEBUG and its only appender to LOGFILE.
#log4j.rootLogger=INFO, CONSOLE
log4j.logger.nl.lunaris.bookdb=DEBUG, LOGFILE

# CONSOLE is set to be a ConsoleAppender
#log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
#log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

# LOGFILE is set to be a FileAppender.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=C:/Projects/Boekenplank/logs/booklog.txt
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


I had tried to log everything else to console first, but then I read that I
can't use the rootLogger (because Geronimo uses that), so I commented that
logger out.
-- 
View this message in context: http://www.nabble.com/log4jResource-setting-in-GBean%3A-ApplicationLog4jConfigurationGBean-tp23936783s134p24422544.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: log4jResource setting in GBean: ApplicationLog4jConfigurationGBean

Posted by chi runhua <ch...@gmail.com>.
Hi Ivpal, looks like the plan is correct.

So as you said "it's still not logging the way I want to."?  we'd like to
know what's your expectation?
Can you deploy your application successfully? Can it be started
successfully?
Is there any exception shown in geronimo.log file?

Jeff C