[logback-user] Dynamically change a variable value for file location

Douglas Moraes doug.manoel at gmail.com
Tue Jun 14 15:14:43 UTC 2016


I want to save my log file in a directory accordingly the current day. For
example, if today is 0614 (June 14th), all log events will go to a folder
0614, and tomorrow I want the logs to go to 0615.

I donĀ“t want use rolling policy. I mean, I want the file to be directly
created in the right place, and not saved in a temporary place and in other
day to be saved in an archive place.

I tryed:

    <timestamp key="DIR" datePattern="MMdd" />
    <appender name="FILE"
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36}:%L -

    <logger name="com.ocs.ProxyHttp.gp2b" level="DEBUG" />

    <root level="DEBUG">
        <appender-ref ref="FILE" />

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20160614/35e71cfc/attachment.html>

More information about the logback-user mailing list