You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Mho <mh...@corybant.com> on 2009/06/01 00:06:42 UTC
How to use log4j.xml in Tomcat-openEJB environment
Hello,
I am familiar with tomcat but new to openEJB. Also I saw the thread from
Sieg but could not figure out what I needed so I am posting this. In case
there is a shortcut, I am using Eclipse for development.
Is there a way to setup the Tomcat-openEJB environment so that when Tomcat
comes up and fires up openEJB it looks at a log4j.xml file that I can edit
and add my own stuff (like nightly rolling file and sending log traces from
different packages to different files etc.)
It looks like openEJB adds some directives for log4j to the file
[tomcat_home]/conf/logging.properties and it seems that it would be a great
thing if there is a way to tell it to use a log4j.xml file and I can put my
stuff in that same file and if there is a system problem I can see whatever
openEJB has to say right next to my log trace.
My specific problem is that I am porting some applications from JBOSS to
openEJB/Tomcat environment and in JBOSS we would modify log4j.xml file tht
JBOSS used and I am just used to that approach. For example
in my Web applications that use Tomcat (w/O openEJB) I make a web
application that just initializes the environment and starts log4j and I
tell Tomcat to start it as soon as it comes up.
Thanks in advance for your help.
--
View this message in context: http://www.nabble.com/How-to-use-log4j.xml-in-Tomcat-openEJB-environment-tp23807412p23807412.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How to use log4j.xml in Tomcat-openEJB environment
Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Mho wrote:
>
> (1) Where does this directive go? Is this going to be inserted in the file
> [tomcat_home]/conf/logging.properties
> in the place of the default logging configurations?
>
It's a system property you can set up with a standard
-Dopenejb.logger.external=true
Or using openejb-jar.xml (as far as I know ;-))
Mho wrote:
>
> (2) I am guessing that the way to make this work would be to create a web
> app with just one servlet that initializes log4j and have it come up, then
> openEJB and then the rest of applications. What is the correct way to
> control the deployment order?
>
In a "standard" tomcat application, you can not define deployment order.
Tomcat usually uses alphabetical order.
When using OpenEJB embedded in Tomcat, the first application loaded is the
OpenEJB webapp and then fall back to standard Tomcat mechanisms.
So from my point of view, the best way to do it is to use the system
property.
Jean-Louis
--
View this message in context: http://www.nabble.com/How-to-use-log4j.xml-in-Tomcat-openEJB-environment-tp23807412p23835659.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How to use log4j.xml in Tomcat-openEJB environment
Posted by Mho <mh...@corybant.com>.
Thanks Jean Louis
Just two more questions:
(1) Where does this directive go? Is this going to be inserted in the file
[tomcat_home]/conf/logging.properties
in the place of the default logging configurations?
(2) I am guessing that the way to make this work would be to create a web
app with just one servlet that initializes log4j and have it come up, then
openEJB and then the rest of applications. What is the correct way to
control the deployment order?
Thanks again for your help
Mho
Jean-Louis MONTEIRO wrote:
>
> Hi,
>
> If you need to control Log4j initialisation, you could set the system
> property
>
> openejb.logger.external=true
>
> Hope it helps.
> Jean-Louis
>
>
> Mho wrote:
>>
>> Hello,
>> I am familiar with tomcat but new to openEJB. Also I saw the thread from
>> Sieg but could not figure out what I needed so I am posting this. In
>> case there is a shortcut, I am using Eclipse for development.
>>
>> Is there a way to setup the Tomcat-openEJB environment so that when
>> Tomcat comes up and fires up openEJB it looks at a log4j.xml file that I
>> can edit and add my own stuff (like nightly rolling file and sending log
>> traces from different packages to different files etc.)
>>
>> It looks like openEJB adds some directives for log4j to the file
>> [tomcat_home]/conf/logging.properties and it seems that it would be a
>> great thing if there is a way to tell it to use a log4j.xml file and I
>> can put my stuff in that same file and if there is a system problem I can
>> see whatever openEJB has to say right next to my log trace.
>>
>> My specific problem is that I am porting some applications from JBOSS to
>> openEJB/Tomcat environment and in JBOSS we would modify log4j.xml file
>> tht JBOSS used and I am just used to that approach. For example
>> in my Web applications that use Tomcat (w/O openEJB) I make a web
>> application that just initializes the environment and starts log4j and I
>> tell Tomcat to start it as soon as it comes up.
>>
>> Thanks in advance for your help.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-use-log4j.xml-in-Tomcat-openEJB-environment-tp23807412p23833136.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
Re: How to use log4j.xml in Tomcat-openEJB environment
Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi,
If you need to control Log4j initialisation, you could set the system
property
openejb.logger.external=true
Hope it helps.
Jean-Louis
Mho wrote:
>
> Hello,
> I am familiar with tomcat but new to openEJB. Also I saw the thread from
> Sieg but could not figure out what I needed so I am posting this. In case
> there is a shortcut, I am using Eclipse for development.
>
> Is there a way to setup the Tomcat-openEJB environment so that when Tomcat
> comes up and fires up openEJB it looks at a log4j.xml file that I can edit
> and add my own stuff (like nightly rolling file and sending log traces
> from different packages to different files etc.)
>
> It looks like openEJB adds some directives for log4j to the file
> [tomcat_home]/conf/logging.properties and it seems that it would be a
> great thing if there is a way to tell it to use a log4j.xml file and I can
> put my stuff in that same file and if there is a system problem I can see
> whatever openEJB has to say right next to my log trace.
>
> My specific problem is that I am porting some applications from JBOSS to
> openEJB/Tomcat environment and in JBOSS we would modify log4j.xml file tht
> JBOSS used and I am just used to that approach. For example
> in my Web applications that use Tomcat (w/O openEJB) I make a web
> application that just initializes the environment and starts log4j and I
> tell Tomcat to start it as soon as it comes up.
>
> Thanks in advance for your help.
>
>
--
View this message in context: http://www.nabble.com/How-to-use-log4j.xml-in-Tomcat-openEJB-environment-tp23807412p23830851.html
Sent from the OpenEJB User mailing list archive at Nabble.com.