You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "DaBuddhaMan (JIRA)" <ji...@apache.org> on 2006/08/24 22:16:06 UTC

[jira] Created: (LOG4NET-91) [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class

[PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class
---------------------------------------------------------------------------------

                 Key: LOG4NET-91
                 URL: http://issues.apache.org/jira/browse/LOG4NET-91
             Project: Log4net
          Issue Type: Improvement
    Affects Versions: 1.2.10
            Reporter: DaBuddhaMan
         Attachments: AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff

If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:

public ILayout Subject 
{
	get { return m_subject; }
	set { m_subject = value; }
}

with configuration like this:

<appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
	<to value="itmon@hhr.be" />
	<from value="Test Program" />
	<subject>
		<conversionPattern value="LOGMSG: [%logger] %level" />
	</subject>

it would be great that we can reuse some code of the AppenderSkeleton class:
So it would be great to add a layout param to the RenderLoggingEvent function.
--> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)

see the attachment


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (LOG4NET-91) [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class

Posted by "DaBuddhaMan (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/LOG4NET-91?page=comments#action_12431230 ] 
            
DaBuddhaMan commented on LOG4NET-91:
------------------------------------

See the result here:

http://www.codeproject.com/useritems/log4net_SmtpAppender.asp



> [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class
> ---------------------------------------------------------------------------------
>
>                 Key: LOG4NET-91
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-91
>             Project: Log4net
>          Issue Type: Improvement
>    Affects Versions: 1.2.10
>            Reporter: DaBuddhaMan
>         Attachments: AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff
>
>
> If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:
> public ILayout Subject 
> {
> 	get { return m_subject; }
> 	set { m_subject = value; }
> }
> with configuration like this:
> <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
> 	<to value="test@test.com" />
> 	<from value="Test Program" />
> 	<subject type="log4net.Layout.PatternLayout, log4net">
> 		<conversionPattern value="LOGMSG: [%logger] %level" />
> 	</subject>
> ...
> it would be great that we can reuse some code of the AppenderSkeleton class:
> So it would be great to add a layout param to the RenderLoggingEvent function.
> --> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)
> see the attachment

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (LOG4NET-91) [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class

Posted by "DaBuddhaMan (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LOG4NET-91?page=all ]

DaBuddhaMan updated LOG4NET-91:
-------------------------------

    Description: 
If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:

public ILayout Subject 
{
	get { return m_subject; }
	set { m_subject = value; }
}

with configuration like this:

<appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
	<to value="test@test.com" />
	<from value="Test Program" />
	<subject type="log4net.Layout.PatternLayout, log4net">
		<conversionPattern value="LOGMSG: [%logger] %level" />
	</subject>
...

it would be great that we can reuse some code of the AppenderSkeleton class:
So it would be great to add a layout param to the RenderLoggingEvent function.
--> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)

see the attachment


  was:
If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:

public ILayout Subject 
{
	get { return m_subject; }
	set { m_subject = value; }
}

with configuration like this:

<appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
	<to value="test@test.com" />
	<from value="Test Program" />
	<subject>
		<conversionPattern value="LOGMSG: [%logger] %level" />
	</subject>
...

it would be great that we can reuse some code of the AppenderSkeleton class:
So it would be great to add a layout param to the RenderLoggingEvent function.
--> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)

see the attachment



> [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class
> ---------------------------------------------------------------------------------
>
>                 Key: LOG4NET-91
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-91
>             Project: Log4net
>          Issue Type: Improvement
>    Affects Versions: 1.2.10
>            Reporter: DaBuddhaMan
>         Attachments: AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff
>
>
> If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:
> public ILayout Subject 
> {
> 	get { return m_subject; }
> 	set { m_subject = value; }
> }
> with configuration like this:
> <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
> 	<to value="test@test.com" />
> 	<from value="Test Program" />
> 	<subject type="log4net.Layout.PatternLayout, log4net">
> 		<conversionPattern value="LOGMSG: [%logger] %level" />
> 	</subject>
> ...
> it would be great that we can reuse some code of the AppenderSkeleton class:
> So it would be great to add a layout param to the RenderLoggingEvent function.
> --> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)
> see the attachment

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (LOG4NET-91) [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class

Posted by "DaBuddhaMan (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LOG4NET-91?page=all ]

DaBuddhaMan updated LOG4NET-91:
-------------------------------

    Description: 
If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:

public ILayout Subject 
{
	get { return m_subject; }
	set { m_subject = value; }
}

with configuration like this:

<appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
	<to value="test@test.com" />
	<from value="Test Program" />
	<subject>
		<conversionPattern value="LOGMSG: [%logger] %level" />
	</subject>
...

it would be great that we can reuse some code of the AppenderSkeleton class:
So it would be great to add a layout param to the RenderLoggingEvent function.
--> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)

see the attachment


  was:
If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:

public ILayout Subject 
{
	get { return m_subject; }
	set { m_subject = value; }
}

with configuration like this:

<appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
	<to value="test@test.com" />
	<from value="Test Program" />
	<subject>
		<conversionPattern value="LOGMSG: [%logger] %level" />
	</subject>

it would be great that we can reuse some code of the AppenderSkeleton class:
So it would be great to add a layout param to the RenderLoggingEvent function.
--> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)

see the attachment



> [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class
> ---------------------------------------------------------------------------------
>
>                 Key: LOG4NET-91
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-91
>             Project: Log4net
>          Issue Type: Improvement
>    Affects Versions: 1.2.10
>            Reporter: DaBuddhaMan
>         Attachments: AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff
>
>
> If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:
> public ILayout Subject 
> {
> 	get { return m_subject; }
> 	set { m_subject = value; }
> }
> with configuration like this:
> <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
> 	<to value="test@test.com" />
> 	<from value="Test Program" />
> 	<subject>
> 		<conversionPattern value="LOGMSG: [%logger] %level" />
> 	</subject>
> ...
> it would be great that we can reuse some code of the AppenderSkeleton class:
> So it would be great to add a layout param to the RenderLoggingEvent function.
> --> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)
> see the attachment

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (LOG4NET-91) [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class

Posted by "DaBuddhaMan (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LOG4NET-91?page=all ]

DaBuddhaMan updated LOG4NET-91:
-------------------------------

    Attachment: AppenderSkeleton.cs.diff

> [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class
> ---------------------------------------------------------------------------------
>
>                 Key: LOG4NET-91
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-91
>             Project: Log4net
>          Issue Type: Improvement
>    Affects Versions: 1.2.10
>            Reporter: DaBuddhaMan
>         Attachments: AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff
>
>
> If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:
> public ILayout Subject 
> {
> 	get { return m_subject; }
> 	set { m_subject = value; }
> }
> with configuration like this:
> <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
> 	<to value="test@test.com" />
> 	<from value="Test Program" />
> 	<subject>
> 		<conversionPattern value="LOGMSG: [%logger] %level" />
> 	</subject>
> it would be great that we can reuse some code of the AppenderSkeleton class:
> So it would be great to add a layout param to the RenderLoggingEvent function.
> --> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)
> see the attachment

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (LOG4NET-91) [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class

Posted by "DaBuddhaMan (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LOG4NET-91?page=all ]

DaBuddhaMan updated LOG4NET-91:
-------------------------------


Probably not such a good suggestion after all!!!

can also just use 

ILayout.Format(
   TextWriter writer,
   LoggingEvent loggingEvent);

> [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class
> ---------------------------------------------------------------------------------
>
>                 Key: LOG4NET-91
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-91
>             Project: Log4net
>          Issue Type: Improvement
>    Affects Versions: 1.2.10
>            Reporter: DaBuddhaMan
>         Attachments: AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff
>
>
> If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:
> public ILayout Subject 
> {
> 	get { return m_subject; }
> 	set { m_subject = value; }
> }
> with configuration like this:
> <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
> 	<to value="test@test.com" />
> 	<from value="Test Program" />
> 	<subject type="log4net.Layout.PatternLayout, log4net">
> 		<conversionPattern value="LOGMSG: [%logger] %level" />
> 	</subject>
> ...
> it would be great that we can reuse some code of the AppenderSkeleton class:
> So it would be great to add a layout param to the RenderLoggingEvent function.
> --> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)
> see the attachment

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (LOG4NET-91) [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class

Posted by "Nicko Cadell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LOG4NET-91?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicko Cadell resolved LOG4NET-91.
---------------------------------

    Resolution: Won't Fix
      Assignee: Nicko Cadell

As you suggest the code to call the Layout.Format method is simple enough that the use if the RenderLoggingEvent function is not required.

Also there is an example appender that allows the Subject line to be rendered from a LayoutPattern in the log4net distribution at examples\net\1.0\Appenders\SampleAppendersApp\cs\src\Appender\SimpleSmtpAppender.cs

> [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class
> ---------------------------------------------------------------------------------
>
>                 Key: LOG4NET-91
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-91
>             Project: Log4net
>          Issue Type: Improvement
>    Affects Versions: 1.2.10
>            Reporter: DaBuddhaMan
>         Assigned To: Nicko Cadell
>         Attachments: AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff
>
>
> If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:
> public ILayout Subject 
> {
> 	get { return m_subject; }
> 	set { m_subject = value; }
> }
> with configuration like this:
> <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
> 	<to value="test@test.com" />
> 	<from value="Test Program" />
> 	<subject type="log4net.Layout.PatternLayout, log4net">
> 		<conversionPattern value="LOGMSG: [%logger] %level" />
> 	</subject>
> ...
> it would be great that we can reuse some code of the AppenderSkeleton class:
> So it would be great to add a layout param to the RenderLoggingEvent function.
> --> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)
> see the attachment

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LOG4NET-91) [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class

Posted by "DaBuddhaMan (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/LOG4NET-91?page=all ]

DaBuddhaMan updated LOG4NET-91:
-------------------------------

     Attachment: AppenderSkeleton.cs.diff
    Description: 
If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:

public ILayout Subject 
{
	get { return m_subject; }
	set { m_subject = value; }
}

with configuration like this:

<appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
	<to value="test@test.com" />
	<from value="Test Program" />
	<subject>
		<conversionPattern value="LOGMSG: [%logger] %level" />
	</subject>

it would be great that we can reuse some code of the AppenderSkeleton class:
So it would be great to add a layout param to the RenderLoggingEvent function.
--> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)

see the attachment


  was:
If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:

public ILayout Subject 
{
	get { return m_subject; }
	set { m_subject = value; }
}

with configuration like this:

<appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
	<to value="itmon@hhr.be" />
	<from value="Test Program" />
	<subject>
		<conversionPattern value="LOGMSG: [%logger] %level" />
	</subject>

it would be great that we can reuse some code of the AppenderSkeleton class:
So it would be great to add a layout param to the RenderLoggingEvent function.
--> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)

see the attachment



> [PATCH] Add layout param to RenderLoggingEvent function of AppenderSkeleton class
> ---------------------------------------------------------------------------------
>
>                 Key: LOG4NET-91
>                 URL: http://issues.apache.org/jira/browse/LOG4NET-91
>             Project: Log4net
>          Issue Type: Improvement
>    Affects Versions: 1.2.10
>            Reporter: DaBuddhaMan
>         Attachments: AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff, AppenderSkeleton.cs.diff
>
>
> If you want to use layouts on other places then the Layout Property, for example if you want to implement a NonBufferedSmtpAppender to use a pattern layout for the subject of the mail message instead of a simple string:
> public ILayout Subject 
> {
> 	get { return m_subject; }
> 	set { m_subject = value; }
> }
> with configuration like this:
> <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
> 	<to value="test@test.com" />
> 	<from value="Test Program" />
> 	<subject>
> 		<conversionPattern value="LOGMSG: [%logger] %level" />
> 	</subject>
> it would be great that we can reuse some code of the AppenderSkeleton class:
> So it would be great to add a layout param to the RenderLoggingEvent function.
> --> RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent, ILayout layout)
> see the attachment

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira