-
1. Re: Inject Logger from slf4j
alexanderbell Dec 11, 2009 2:36 PM (in response to alexanderbell)BTW do anybody know where the logging-config is located in JBoss 6.0 M1?
I cannot find it because in directory ../server/default/conf there isn't a jboss-logging-config.Alex
-
2. Re: Inject Logger from slf4j
luxspes Dec 11, 2009 4:55 PM (in response to alexanderbell)Maybe the transient keyword can help you?
-
3. Re: Inject Logger from slf4j
dan.j.allen Dec 11, 2009 6:13 PM (in response to alexanderbell)Is server/default/conf/jboss-log4j.xml what you are looking for? Or are you looking for control over which logging framework is used? Best to ask over here: JBoss AS user forums
-
4. Re: Inject Logger from slf4j
dan.j.allen Dec 11, 2009 6:16 PM (in response to alexanderbell)The transient keyword is not sufficient because it's not OK if injected loggers just disappear after passivation. As Gavin suggests on the mailinglist, we need to support injection into static fields to solve this type of problem.
The other solution, I believe, is to injected a scoped logger so that you get a proxy rather than a hard reference.
-
5. Re: Inject Logger from slf4j
alexanderbell Dec 11, 2009 6:22 PM (in response to alexanderbell)@Dan
thanks.
Injection into static field would be great.
Regarding the log4j config. Hmm ok I expected the jboss-log4j.xml in /server/default/conf but I cannot find it. Probably I have to download a new Build of AS6.0 becaus I've got a snapshot before M1.As long as injection into static field is not support I'm gonna create my logger via plain instatiation.
Thanks Alex
-
6. Re: Inject Logger from slf4j
dan.j.allen Dec 11, 2009 6:27 PM (in response to alexanderbell)Definitely go for M1. It is the most reliable release (I guess that's why it is a milestone, hehehe)
As I always say, do what makes you productive. If @Logger is causing you problems, don't fight against the grain right now. For your own work, just instantiate it. You won't lose a toe. If you are interested in helping w/ the idea for static field injection, or impl, then we invite you to jump in there as well ;)
-
7. Re: Inject Logger from slf4j
cgulcu Dec 11, 2009 10:58 PM (in response to alexanderbell)Although the Logger interface does not extend java.io.Serializable, all Logger implementations which ship with SLF4J do implement java.io.Serializable. I am quite surprised to learn that Logger serialization is causing problems. Could you provide more details on what you are trying to do and how that fails? BTW, which logging framework are you using?
-
8. Re: Inject Logger from slf4j
gavin.king Dec 12, 2009 6:14 PM (in response to alexanderbell)Yes, please post the exception stack trace. It might actually be a bug in Weld.