ok, so basically I shouldn't try and us log4j, but instead use the
jboss.logging.
pity,
thanks anyway
Steve
-----Original Message-----
From: David Jencks [mailto:[EMAIL PROTECTED]]
Sent: 24 April 2001 15:33
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Configuring Jboss to use Log4j ?
Hi, the current log4j connection with jboss ignores almost all good
features of log4j and duplicates much of its functionality. That being
said, using the non-log4j method of getting a log ends up with the logging
going through log4j. I hope I haven't left anything important out here, I
haven't tried to log from within a bean. A recent 2.3 patch lets you treat
log names ( the stuff that shows up in []) as log4j categories.
the log
org.jboss.logging.Log log;
when you create your object
log = Log.createLog("myname");
when you want to log something
Log.setLog(log); //duplicates NDC.push(source) log4j functionality
log.log("my message");
Log.unsetLog(log); //duplicates NDC.pop() log4j functionality
On 2001.04.24 08:24:01 -0400 "Doyle, Steven" wrote:
> Hi,
>
> I'm reasonably new to jboss, and I am having difficulty getting JBoss to
> use
> Log4j
>
> I have uncommented the relevant lines in jboss.conf and also removed the
> default file & console logging.
>
> The service seems to start ok, except I get duplicate log entries
> appearing
> in the Jboss console. However I am unable to make my own logs using the
> Log4j.properties files supplied with Jboss.
>
> Here is my code:
>
> //Initialize logging
> logService=new Log4jService();
> logService.start();
>
> Properties serviceProperties=new Properties();
> serviceProperties.load(new
> FileInputStream("c:/jboss-2.2.1/conf/default/log4j.properties"));
> PropertyConfigurator.configure(serviceProperties);
>
> // get a category instance
> cat = Category.getRoot();
>
> I get an exception org.apache.log4j.FileAppender saying that
>
> A "org.apache.log4j.FileAppender" object is not assignable to a
> "org.apache.log4j.Appender" object.
>
>
> This is probably just a school boy error on my part, but does anyone have
> an
> example piece of code thast does this properly.
>
> cheers
>
> Steve Doyle
>
> _______________________________________________
> 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