The Log4jService works fine for me with this jboss.conf entry:
<MLET CODE = "org.jboss.logging.Log4jService" ARCHIVE="jboss.jar,log4j.jar"
CODEBASE="../../lib/ext/">
</MLET>
Send the exception stack trace you are seeing if this is not working.
----- Original Message -----
From: "François Charoy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 17, 2001 8:02 AM
Subject: Re: [JBoss-user] Jboss and Log4j
> You are true but the Log4j initialisation is done when jboss is started. So
> I'm not sure that the property file would be useful.
> I tried to use the Log4jService but I have never been able to start the
> service. With this service you can configure the place of your
> log4j.properties file and changes are checked periodically. I uncomment the
> lines in jboss.conf but it did not change anything. Thus I tried to start it
> manually but I got a preRegister exception and that's all...
>
> Did somebody succeed in starting the log4j service ? what should I do ?
>
> thanks in advance
>
> françois
>
>
>
> ----- Original Message -----
> From: "Filip Hanik" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, April 16, 2001 7:05 PM
> Subject: RE: [JBoss-user] Jboss and Log4j
>
>
> > you can easily load a property file using the class loader.
> > this means that you don't have to know the location of your property file,
> > you will simply load it from the class path
> >
> >
> Thread.currentThread().getContextClassLoader().getResourceAsStream("yourprop
> > ertyfile.properties");
> >
> > will do the trick for you
> >
> > Filip
> >
> > ~
> > Namaste - I bow to the divine in you
> > ~
> > Filip Hanik
> > Software Architect
> > [EMAIL PROTECTED]
> > www.filip.net
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of Simphoukham,
> > > Southin
> > > Sent: Monday, April 16, 2001 9:47 AM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: RE: [JBoss-user] Jboss and Log4j
> > >
> > >
> > > With Log4j you have several options: a properties file, a xml
> > > file, or java
> > > properties. The first two, you must open up a FileInputStream,
> therefore
> > > you must provide the location of the file. That works great if you are
> > > using Windows but with Unix the structure is a bit different plus I
> wanted
> > > to have everything in a war file. I tried jarring it up and using
> java.io
> > > via jarinputstream to read the file, etc. Major headache. The easiest
> way
> > > was to place the info into a constants file, obviously not the best way
> > > since you have to hard code. For me if I have to hard code something it
> > > sits in a constants file.
> > >
> > > import org.apache.log4j.PropertyConfigurator;
> > > import org.apache.log4j.*;
> > > import org.apache.log4j.Category.*;
> > >
> > > eg:
> > >
> > > this.serviceProperties = new Properties();
> > >
> > > this.serviceProperties.setProperty("log4j.rootCategory",com.Consta
> > > nts.ROOT_C
> > > ATEGORY);
> > >
> > > this.serviceProperties.setProperty("log4j.appender.A1",com.Constan
> > > ts.PowerCo
> > > nstants.A1);
> > >
> > >
> > > //this class from log4j does all the work involved in
> > > setting up the
> > > file
> > >
> > > PropertyConfigurator.configure(this.serviceProperties);
> > >
> > > My constants file looks like this.
> > >
> > > public final static String ROOT_CATEGORY = ", A1, A2";
> > > public final static String A1 = "org.apache.log4j.FileAppender";
> > > public final static String A1_FILE = "System.out";
> > >
> > > Southin
> > >
> > > -----Original Message-----
> > > From: Miranda Carlos [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, April 16, 2001 11:13 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: [JBoss-user] Jboss and Log4j
> > >
> > >
> > >
> > > How ?
> > > Thanks .-
> > >
> > > -----Original Message-----
> > > From: Simphoukham, Southin [ mailto:[EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]> ]
> > > Sent: Viernes, 13 de Abril de 2001 06:12 p.m.
> > > To: '[EMAIL PROTECTED]'
> > > Subject: RE: [JBoss-user] Jboss and Log4j
> > >
> > >
> > > I solved the problem. Put everything into properties, hard code it to a
> > > constants file.
> > >
> > > -----Original Message-----
> > > From: Simphoukham, Southin [ mailto:[EMAIL PROTECTED]
> > > <mailto:[EMAIL PROTECTED]> ]
> > > Sent: Friday, April 13, 2001 11:04 AM
> > > To: '[EMAIL PROTECTED]'
> > > Subject: [JBoss-user] Jboss and Log4j
> > >
> > >
> > >
> > > Does JBoss 2.2 integrate Log4J? Has anyone tried using it with JBoss? I
> > > remember seeing a thread on it.
> > >
> > > I am working on the logging portion of my application. It works great
> in
> > > Windows NT and 2000. Once I port it over to Unix, Log4J cannot find the
> > > configuration file. Ideally I would like to drop the configuration file
> > > into a war file so I can just drop it into the deploy directory.
> > > My problem
> > >
> > > now is how do I read the properties file from a war file and put
> > > it into an
> > > inputstream.
> > >
> > > Thanks,
> > >
> > > Southin
> > >
> > > _______________________________________________
> > > JBoss-user mailing list
> > > [EMAIL PROTECTED]
> > > http://lists.sourceforge.net/lists/listinfo/jboss-user
> > > <http://lists.sourceforge.net/lists/listinfo/jboss-user>
> > >
> > > _______________________________________________
> > > JBoss-user mailing list
> > > [EMAIL PROTECTED]
> > > http://lists.sourceforge.net/lists/listinfo/jboss-user
> > > <http://lists.sourceforge.net/lists/listinfo/jboss-user>
> > >
> > >
> > > _______________________________________________
> > > JBoss-user mailing list
> > > [EMAIL PROTECTED]
> > > http://lists.sourceforge.net/lists/listinfo/jboss-user
> > >
> >
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
> >
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user