[logback-user] Variable substitution for logger name?

Robert Kuhar robertkuhar at gmail.com
Sat Mar 2 05:10:06 CET 2013


Its not proper XML is it?  If it works at all, I would expect it to
work as <logger name="${appLoggerPrefix}" level="INFO">

On Fri, Mar 1, 2013 at 7:43 AM,  <Mark.Boatman at securian.com> wrote:
> Is it possible to use variable substitution with the <logger name>?
>
> Here is my configuration xml.  Everything works EXCEPT this:  <logger
> name=${appLoggerPrefix} level="INFO">
>
> Is that not allowed?
>
> <?xml version="1.0" encoding="UTF-8" ?>
>
> <configuration debug="true">
>         <property
> resource="com/minnesotamutual/corp/compliance/end/config/app.properties" />
>         <property name="LOGS_PATH"
> value="${com.minnesotamutual.appLogs}/${appName}/" />
>         <property name="SPRING_LOG_BASE_FILENAME" value="${appName}-spring"
> />
>         <property name="APP_LOG_BASE_FILENAME" value="${appName}-app" />
>
>         <appender name="SpringLogFileAppender"
> class="ch.qos.logback.core.rolling.RollingFileAppender">
>                 <file>${LOGS_PATH}${SPRING_LOG_BASE_FILENAME}.log</file>
>                 <rollingPolicy
> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>
> <fileNamePattern>${LOGS_PATH}${SPRING_LOG_BASE_FILENAME}-%d{yyyy-MM-dd}.log</fileNamePattern>
>                         <maxHistory>30</maxHistory>
>                 </rollingPolicy>
>                 <encoder>
>                         <pattern>%date [%level] at line %line in
> %class[%method]: %msg%n</pattern>
>                 </encoder>
>         </appender>
>
>         <appender name="AppLogFileAppender"
> class="ch.qos.logback.core.rolling.RollingFileAppender">
>                 <file>${LOGS_PATH}${APP_LOG_BASE_FILENAME}.log</file>
>                 <rollingPolicy
> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>
> <fileNamePattern>${LOGS_PATH}${APP_LOG_BASE_FILENAME}-%d{yyyy-MM-dd}.log</fileNamePattern>
>                         <maxHistory>30</maxHistory>
>                 </rollingPolicy>
>                 <encoder>
>                         <pattern>%date [%level]: %msg%n</pattern>
>                 </encoder>
>         </appender>
>
>         <logger name=${appLoggerPrefix} level="INFO">
>                 <appender-ref ref="AppLogFileAppender" />
>         </logger>
>
>         <logger name="org.springframework" level="INFO">
>                 <appender-ref ref="SpringLogFileAppender" />
>         </logger>
>
>         <root level="INFO">
>         </root>
>
>
>
>
> ________________________________
> Mark E. Boatman, FLMI
> Applications Consultant, Corp/PFC/Inv Systems, Information Technology  •
> Securian Financial Group
> 400 Robert Street North  •  A9-4949  •  St. Paul, MN 55101-2098
> 651-665-4949
> mark.boatman at securian.com  •  www.securian.com
>
> Securian Financial Group – Financial security for the long run ®
>
>
> This email transmission and any file attachments may contain confidential
> information intended solely for the use of the individual or entity to whom
> it is addressed. If you have received this email message in error, please
> notify the sender and delete this email from your system. If you are not the
> intended recipient, you may not disclose, copy, or distribute the contents
> of this email.
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user


More information about the Logback-user mailing list