Re: [JBoss-user] Logging from within EJBs

2002-07-08 Thread Dimitri PISSARENKO

Hello!

Thanks everyone, now logging works as desired!

Dimitri

On Mon, 8 Jul 2002 12:27:09 +0100, you wrote:

>On Mon, Jul 08, 2002 at 12:42:30AM +0200, Dimitri PISSARENKO wrote:
>
>
>
>> does not work in my case (although logger.isDebugEnabled() returns
>> true).
>> 
>> Does someone know, how one can get the reference to the Logger from
>> wihin an EJB?
>
>I found that I needed to drop the Console appenders "Threshold" to
>DEBUG. You'll also need to limit the "org.jboss" category to "INFO" if
>you do this, but that should be a case of editing the log4j.xml file
>in the server/${server.name}/conf directory. I also added a category
>for my own classes.
>
>The log4j.xml that ships with JBoss is well commented, so you
>shouldn't find anything too frightening.
>
>Cheers,
>
>Simon



---
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Logging from within EJBs

2002-07-08 Thread Simon Stewart

On Mon, Jul 08, 2002 at 12:42:30AM +0200, Dimitri PISSARENKO wrote:



> does not work in my case (although logger.isDebugEnabled() returns
> true).
> 
> Does someone know, how one can get the reference to the Logger from
> wihin an EJB?

I found that I needed to drop the Console appenders "Threshold" to
DEBUG. You'll also need to limit the "org.jboss" category to "INFO" if
you do this, but that should be a case of editing the log4j.xml file
in the server/${server.name}/conf directory. I also added a category
for my own classes.

The log4j.xml that ships with JBoss is well commented, so you
shouldn't find anything too frightening.

Cheers,

Simon

-- 
"The idea of a karaoke version of ``My Way'' that lasts for 3750
minutes is just too frightening to consider."
Programming Ruby, the Pragmatic Programmers


---
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Logging from within EJBs

2002-07-07 Thread Guy Rouillier

Thanks for pointing that out - I do indeed have a downlevel version of log4j
source code.  However, the JBoss source is NOT using
org.apache.log4j.Logger, which as you point out extends Category.  Instead
the source is using org.jboss.logging.Logger, which does not extend
Category, but instead wraps it.

- Original Message -
From: "Andreas Kuckartz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 08, 2002 12:41 AM
Subject: Re: [JBoss-user] Logging from within EJBs


> > How can JBoss deprecate an interface in a separate package?
>
> Category has been deprecated by the log4j project:
>
> "This class has been deprecated and replaced by the Logger subclass. It
will
> be kept around to preserve backward compatibility until mid 2003.
>
> Logger is a subclass of Category, i.e. it extends Category. In other
words,
> a logger is a category. Thus, all operations that can be performed on a
> category can be performed on a logger. Whenever log4j is asked to produce
a
> Category object, it will instead produce a Logger object. However, methods
> that previously accepted category objects still continue to accept
category
> objects.
>
> For example, the following are all legal and will work as expected.
>
>// Deprecated form:
>Category cat = Category.getInstance("foo.bar")
>
>// Preferred form for retrieving loggers:
>Logger logger = Logger.getLogger("foo.bar")
>
> The first form is deprecated and should be avoided.
>
> There is absolutely no need for new client code to use or refer to the
> Category class. Whenever possible, please avoid referring to it or using
> it."
>
> http://jakarta.apache.org/log4j/docs/api/index.html
>
> Andreas
>
>
>
>
> ---
> This sf.net email is sponsored by:ThinkGeek
> Oh, it's good to be a geek.
> http://thinkgeek.com/sf
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>




---
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Logging from within EJBs

2002-07-07 Thread Andreas Kuckartz

> How can JBoss deprecate an interface in a separate package?

Category has been deprecated by the log4j project:

"This class has been deprecated and replaced by the Logger subclass. It will
be kept around to preserve backward compatibility until mid 2003.

Logger is a subclass of Category, i.e. it extends Category. In other words,
a logger is a category. Thus, all operations that can be performed on a
category can be performed on a logger. Whenever log4j is asked to produce a
Category object, it will instead produce a Logger object. However, methods
that previously accepted category objects still continue to accept category
objects.

For example, the following are all legal and will work as expected.

   // Deprecated form:
   Category cat = Category.getInstance("foo.bar")

   // Preferred form for retrieving loggers:
   Logger logger = Logger.getLogger("foo.bar")

The first form is deprecated and should be avoided.

There is absolutely no need for new client code to use or refer to the
Category class. Whenever possible, please avoid referring to it or using
it."

http://jakarta.apache.org/log4j/docs/api/index.html

Andreas




---
This sf.net email is sponsored by:ThinkGeek
Oh, it's good to be a geek.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Logging from within EJBs

2002-07-07 Thread Guy Rouillier

How can JBoss deprecate an interface in a separate package?  I see what you
are referring to - jboss-all\common\src\main\org\jboss\logging\Logger.java
wraps Category so it can introduce Trace level logging.  I wasn't aware of
this - thanks for pointing it out.  I don't necessarily agree with it (since
Log4j is a standalone package, I think it would be better to stay compatible
with it.)  We are, of course, free to continue to use the Category
interface.

- Original Message -
From: "Stephen Coy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 07, 2002 10:29 PM
Subject: Re: [JBoss-user] Logging from within EJBs


> He *is* using log4j. Your suggestion below is a "deprecated" interface.
>
> I suspect that he is not looking in the right place for the debug
> messages.
>
> Debug messages only appear in the log/server.log file, not on the
> console.
>
> This works for us btw.
>
>
> On Monday, July 8, 2002, at 11:34  AM, Guy Rouillier wrote:
>
> > Use log4j, e.g.,
> >
> >private final Category log =
> > Category.getInstance(getClass().getName());
> >
> > - Original Message -
> > From: "Dimitri PISSARENKO" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, July 07, 2002 6:42 PM
> > Subject: [JBoss-user] Logging from within EJBs
> >
> >
> > Hello!
> >
> > I want some of the events in the life of my EJBs to be logged at debug
> > level. The usual way to get an instance of Logger
> >
> > class ProjectBean ...
> > {
> > ...
> > private Logger logger = Logger.getLogger(ProjectBean.class);
> > }
> >
> > and invokation of
> >
> > if (logger.isDebugEnabled())
> > {
> > logger.debug("...")
> > }
> >
> > does not work in my case (although logger.isDebugEnabled() returns
> > true).
> >
> > Does someone know, how one can get the reference to the Logger from
> > wihin an EJB?
> >
> > Thanks
> >
> > Dimitri Pissarenko
> >
> >
> > ---
> > This sf.net email is sponsored by:ThinkGeek
> > We have stuff for geeks like you.
> > http://thinkgeek.com/sf
> > ___
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> >
> >
> >
> >
> >
> > ---
> > This sf.net email is sponsored by:ThinkGeek
> > We have stuff for geeks like you.
> > http://thinkgeek.com/sf
> > ___
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
>
> ---
> This sf.net email is sponsored by:ThinkGeek
> We have stuff for geeks like you.
> http://thinkgeek.com/sf
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>




---
This sf.net email is sponsored by:ThinkGeek
We have stuff for geeks like you.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Logging from within EJBs

2002-07-07 Thread Stephen Coy

He *is* using log4j. Your suggestion below is a "deprecated" interface.

I suspect that he is not looking in the right place for the debug 
messages.

Debug messages only appear in the log/server.log file, not on the 
console.

This works for us btw.


On Monday, July 8, 2002, at 11:34  AM, Guy Rouillier wrote:

> Use log4j, e.g.,
>
>private final Category log = 
> Category.getInstance(getClass().getName());
>
> - Original Message -
> From: "Dimitri PISSARENKO" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, July 07, 2002 6:42 PM
> Subject: [JBoss-user] Logging from within EJBs
>
>
> Hello!
>
> I want some of the events in the life of my EJBs to be logged at debug
> level. The usual way to get an instance of Logger
>
> class ProjectBean ...
> {
> ...
> private Logger logger = Logger.getLogger(ProjectBean.class);
> }
>
> and invokation of
>
> if (logger.isDebugEnabled())
> {
> logger.debug("...")
> }
>
> does not work in my case (although logger.isDebugEnabled() returns
> true).
>
> Does someone know, how one can get the reference to the Logger from
> wihin an EJB?
>
> Thanks
>
> Dimitri Pissarenko
>
>
> ---
> This sf.net email is sponsored by:ThinkGeek
> We have stuff for geeks like you.
> http://thinkgeek.com/sf
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
>
>
>
>
> ---
> This sf.net email is sponsored by:ThinkGeek
> We have stuff for geeks like you.
> http://thinkgeek.com/sf
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user



---
This sf.net email is sponsored by:ThinkGeek
We have stuff for geeks like you.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Logging from within EJBs

2002-07-07 Thread Guy Rouillier

Use log4j, e.g.,

   private final Category log = Category.getInstance(getClass().getName());

- Original Message - 
From: "Dimitri PISSARENKO" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 07, 2002 6:42 PM
Subject: [JBoss-user] Logging from within EJBs


Hello!

I want some of the events in the life of my EJBs to be logged at debug
level. The usual way to get an instance of Logger

class ProjectBean ...
{
...
private Logger logger = Logger.getLogger(ProjectBean.class);
}

and invokation of

if (logger.isDebugEnabled())
{
logger.debug("...")
}

does not work in my case (although logger.isDebugEnabled() returns
true).

Does someone know, how one can get the reference to the Logger from
wihin an EJB?

Thanks

Dimitri Pissarenko


---
This sf.net email is sponsored by:ThinkGeek
We have stuff for geeks like you.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user






---
This sf.net email is sponsored by:ThinkGeek
We have stuff for geeks like you.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



[JBoss-user] Logging from within EJBs

2002-07-07 Thread Dimitri PISSARENKO

Hello!

I want some of the events in the life of my EJBs to be logged at debug
level. The usual way to get an instance of Logger

class ProjectBean ...
{
...
private Logger logger = Logger.getLogger(ProjectBean.class);
}

and invokation of

if (logger.isDebugEnabled())
{
logger.debug("...")
}

does not work in my case (although logger.isDebugEnabled() returns
true).

Does someone know, how one can get the reference to the Logger from
wihin an EJB?

Thanks

Dimitri Pissarenko


---
This sf.net email is sponsored by:ThinkGeek
We have stuff for geeks like you.
http://thinkgeek.com/sf
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user