[logback-user] Configuration in code only

Yair Ogen yairogen at gmail.com
Mon Nov 14 13:09:32 CET 2011


Hi,

I am a part of an infrastructure team in my company. I have a requirement
where I need to support logback configured from code only (infrastructure
code). I cannot have users define a logback config file in their respective
modules.

The goal is to have an infrastructure module that reads configuration from
a property file (not log4j.properties). This file is the placeholder for
all the application real configuration. We defined a "language" in which
users can instruct the infrastructure on how to configure logback. E.g.:

logger.com.mycompany.1.appender.name=rollingFile
logger.com.mycompany.1.appender.layout=%m%n

My code parses these properties and needs to configure logback accordingly.

My question is  - how do I configure logback in code (assuming the main
class is managed by application teams and not infra). I need to wrap a
concise logback config file inside the infra module (jar) that holds just
enough to give me the code "window" in which I can start the parsing
mentioned above.

Any ideas?

Thanks,

Yair
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111114/0f91f8de/attachment.html>


More information about the Logback-user mailing list