[logback-user] Logback-beagle with config file used for multiple environments

Chris Pratt thechrispratt at gmail.com
Thu Jul 26 19:11:33 CEST 2012


Add your logback-test.xml file to a location that is only on the classpath
on your development/test machines (almost always outside of the war file
itself), then use the Configuration File Inclusion mechanism to include
your production logback.xml file [
http://logback.qos.ch/manual/configuration.html#fileInclusion]
  (*Chris*)

On Thu, Jul 26, 2012 at 9:59 AM, Noremac <cam at byu.edu> wrote:

> Chris Pratt <thechrispratt at ...> writes:
>
> >
> >
> > I think you can put it in logback-test.xml
> >  (*Chris*)
> >
> > On Tue, Jul 24, 2012 at 3:31 PM, Noremac <cam at byu.edu>
> wrote:I found the newly released Logback-Beagle to look pretty cool. I
> want it!
> > However, I see that you need to add the tag <consolePlugin /> to the
> config
> > file. This makes me worry a little about the implications on this when
> that
> > same config file is used in test and production.
> > So it looks like if I add the consolePlugin then I'll be having an added
> > appender trying to spit out logs to the local machine (not desired).
> > Basically, I only want the extra appender in development. Is there any
> other
> > way to do this other than doing it programmatically (by doing a check on
> > which environment it is in).
> > _______________________________________________
> > Logback-user mailing listLogback-user-
> vdLmLxQ6Fys at public.gmane.orghttp://
> mailman.qos.ch/mailman/listinfo/logback-user
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Logback-user mailing list
> > Logback-user at ...
> > http://mailman.qos.ch/mailman/listinfo/logback-user
>
> I could put it in the logback-test.xml file, but that won't change
> anything as
> only either the logback-test.xml or logback.xml will be used for
> configuration.
> I'd still need an external mechanism to put a different file in the class
> path
> based on the environment. I want to use the same code for every
> environment.
>
> I have added logic to programmatically set up the SocketAppender and add
> it to
> the root logger if the environment is development. It's working well, just
> not
> sure this is the best way given my preferences.
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120726/5c9c7d98/attachment.html>


More information about the Logback-user mailing list