>From the javadoc: SocketAppenders do not use a layout. They ship a serialized LoggingEvent object to the server side.
Therefore you need to get "Joel" into the LoggingEvent. You could do that with MDC. You could also have each project connect to a different port and have the server translate the port to the project. On 6/22/05, James Stauffer <[EMAIL PROTECTED]> wrote: > Did you try (Joel) instead of [Joel]. > > Does SocketAppender even use a conversion pattern? I thought it just > serialized the event. > > On 6/22/05, Schuweiler, Joel J. <[EMAIL PROTECTED]> wrote: > > I would love to do it with package names but that would force everyone to > > use packages. Unfortunately lots of folks don't. > > > > The [joel] doesn't come through on the server socket side. Using ethereal > > it didn't appear to even be sent over the network. > > > > -----Original Message----- > > From: Javier Gonzalez [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, June 22, 2005 2:18 PM > > To: Log4J Users List > > Subject: Re: Log4j.properties questions with ConversionPattern and Appender > > > > On 6/22/05, Schuweiler, Joel J. <[EMAIL PROTECTED]> wrote: > > > Assuming I had a bunch of lines like > > > > > > Logger.debug("Joels project " + someOtherString); > > > > > > And set it up the conversion pattern to display the message first I could > > > simply check > > > what the first line starts with and split the log up into a bunch of > > > smaller logs. What I'm > > > wondering if there is an easier way to add "Joels Project" to every log > > > message. > > > > Mmmm, you could have your developers put a distinctive package name in > > their hierachy, and then start the conversion pattern with the Logger > > name (asuming you create your loggers using the usual > > Logger.getLogger(ThisClass.class)) > > > > Then you'd start getting messages like this: > > > > foo.bar.joelsproject.SomeClass: <message...> > > foo.bar.bobsproject.SomeOtherClass: <message...> > > foo.bar.janesproject.YetAnotherClass: <message...> > > > > Looking at your properties file, doesn't putting [Joel's] in the > > pattern work? Or you have multiple projects using the same log4j > > configuration? > > > > -- > > Javier Gonzalez Nicolini > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > James Stauffer > Are you good? Take the test at http://www.livingwaters.com/good/ > -- James Stauffer Are you good? Take the test at http://www.livingwaters.com/good/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
