I would prefer using org.jboss as the root, such that category names can be
generated from classnames. I am undescided about the best way to append
other information to the category.
Specifically, I want to specify a tag and instance id, but there does not
seem to be a nice way to do this in Log4j. In a logging system that I have
been working on and using for a while, a category might look something like
this:
some.package.SomeClass#sometag@837849
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^
category tag id
The cat & id can be determined from any Object, and the tag can optionaly be
assocated at Logger construction time.
Unfortunatly with this scheme in Log4j (I belive), that for each instance, a
new category will be created. Also it makes it harder to limit a given
classes logging output, that can only be done on a per package basis.
I thought that NDC might make a nice way to add tagging information, but to
effectivly manage this wouldn't we have to
NDC.push("blah");
try {
// something
}
finally {
NDC.pop();
}
It also looks like there is other use of NDC currently not to mention that
the method in which it is added to the output is not very plesant.
Something that might work, would be to do something like this:
some.package.SomeClass.SomeClass#sometag@837849
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^
category tag id
This would add more categories and also make log output a bit more verbose
with %c, but would still provide enough information with %c{1}.
Loggers could then be created, by passing in a reference to 'this' or a
class for non-instance logging as well as an optional tag.
Tags could be gotten in a NDC fashion, so that instances do not need to
pass aroung logger objects or tag names, but I am not sure how that would
work out at the moment. My guess is that NDC will not be used in this
fashion, and will continue to simply be an aide for debugging? Though I am
not sure about that. NDC is very, very cool... I just have not gotten the
hang of it just yet.
--jason
On Wed, 11 Jul 2001, Dain Sundstrom wrote:
> I posted the original message to the wrong forum (user forum), and almost
> lost the responses in all the traffic.
>
> I will switch over to direct log4j soon.
>
> Has anyone given any thought to how we should organize the log categories?
>
> For example, what root are we going to use 'jboss' or 'org.jboss'?
>
> I think we should follow class package name as close a possible, so cmp
> messages would start at 'org.jboss.ejb.plugins.cmp'.
>
> My current plan is to use
> 'org.jboss.ejb.plugins.cmp.<BeanName>.<JDBCCommandName>'
>
> -dain
>
> > -----Original Message-----
> > From: Scott M Stark [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, July 10, 2001 2:48 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [JBoss-user] log4j or JBoss logging
> >
> >
> > Change to use log4j. The JBoss interface will disappear in 3.0
> >
> > ----- Original Message -----
> > From: "Dain Sundstrom" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 10, 2001 12:08 PM
> > Subject: [JBoss-user] log4j or JBoss logging
> >
> >
> > > As I modify the JBossCMP code should I change the logging
> > over to use
> > log4j
> > > directly or should I leave the code logging via the JBoss log layer?
> > >
> > > If I should switch to direct log4j, how do we categorize
> > the logs? I was
> > > thinking jboss.ejb.plugins.cmp.<BeanName>.<JDBCCommandName>
> > or some thing
> > > like that. This way I could turn off messages from beans
> > and commands I'm
> > > not testing.
> > >
> > > -dain
> > >
> > > _______________________________________________
> > > 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-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development
>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development