logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Bodewig (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4NET-316) Provide a Layout Pattern that is re-evaluated on each use
Date Mon, 28 Nov 2011 16:27:39 GMT

    [ https://issues.apache.org/jira/browse/LOG4NET-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13158536#comment-13158536
] 

Stefan Bodewig commented on LOG4NET-316:
----------------------------------------

code looks good to me but I wonder whether it wouldn't be easier to add a property "dynamic"
to the existing PatternLayout rather than creating a subclass.
                
> Provide a Layout Pattern that is re-evaluated on each use
> ---------------------------------------------------------
>
>                 Key: LOG4NET-316
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-316
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Other
>    Affects Versions: 1.2.11
>            Reporter: Roy Chastain
>            Priority: Minor
>              Labels: features
>         Attachments: DynamicPatternLayout.cs
>
>
> The DynamicPatternLayout is a layout pattern that is re-evaluated on each use.  It is
appropriate to use instead of LayoutPattern to provide dynamic strings in headers and footers
for appenders.  Datetime is an example.  Using the standard layout pattern results in the
same datetime in each header and footer, while using DynamicPatternLayout results in timestamp
of the header/footer creation.
> Example
> <layout type="log4net.Layout.DynamicPatternLayout">
>   <param name="Header" value="%newline**** Trace Opened     Local: %date{yyyy-MM-dd
HH:mm:ss.fff}     UTC: %utcdate{yyyy-MM-dd HH:mm:ss.fff} ****%newline"/>
>   <param name="Footer" value="**** Trace Closed %date{yyyy-MM-dd HH:mm:ss.fff} ****%newline"/>
> </layout>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message