Close popover
Sharath Babu Nagamangala Govindaiah (SharathBabu523)

SharathBabu523 Member since 2016 11 posts
Posted: March 9, 2018
Last activity: March 14, 2018

How to Change Log4Net Rolling file appender to smtp appender or ADODB appender

Hi All,

Currently log4net publisher logs the data in a file according to the configuration done in Runtimeconfig.xml > log4net publisher > innerXML.

I want the log4net to publish into different appenders such as SMTP or ADO.NET and other things. I tried changing the inerXML to appropriate appenders ( as given in the url : by appropriate encoding) and getting the below error. Does any one have idea how to use it or open span does not support it ?

OpenSpan.Diagnostic Internal Exception

Exception Report

1) Exception Information
Exception Type: System.InvalidCastException
Message: "Unable to cast object of type 'log4net.Appender.SmtpAppender' to type 'log4net.Appender.FileAppender'."
Data: IDictionary (System.Collections.ListDictionaryInternal) with 0 items
TargetSite: Boolean Initialize(System.String, System.Collections.Specialized.NameValueCollection, Boolean)
HelpLink: NULL
Source: "OpenSpan"
HResult: -2147467262

StackTrace Information
at OpenSpan.Diagnostics.Publishers.Log4NetPublisher.Initialize(String identity, NameValueCollection settings, Boolean validateInternalState)
at OpenSpan.Diagnostics.Diagnostic.Initialize()


Note : i am able to achieve it using script method and the appender of my choice, but i want to achieve using the built-in log4net publisher and avoid C# scripting.

Robotic Process Automation
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.