You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added the following config to an existing log4net configuration running under Sitecore on .net 4.8
<log4net>
<appender name="SentryAppender" type="Sentry.Log4Net.SentryAppender, Sentry.Log4Net">
<Dsn value="https://**************************************************************" />
<!--Sends the log event Identity value as the user-->
<SendIdentity value="true" />
<Environment value="Test" />
<bufferSize value="1"/>
<threshold value="ERROR" />
</appender>
<root>
<appender-ref ref="SentryAppender"/>
</root>
</log4net>
Expected Result
No error during initialization.
Actual Result
log4net: DOMConfigurator: Loading Appender [SentryAppender] type: [Sentry.Log4Net.SentryAppender, Sentry.Log4Net]
log4net:ERROR DOMConfigurator: Could not create Appender [SentryAppender] of type [Sentry.Log4Net.SentryAppender, Sentry.Log4Net]. Reported error follows.
System.InvalidCastException: Unable to cast object of type 'Sentry.Log4Net.SentryAppender' to type 'log4net.Appender.IAppender'.
at log4net.Repository.Hierarchy.DOMHierarchyConfigurator.ParseAppender(XmlElement appenderElement)
log4net:ERROR DOMConfigurator: Appender named [SentryAppender] not found.
The text was updated successfully, but these errors were encountered:
Hey @khsd, sorry to see you run into issues.
I'm not quite sure how to go about this. The SentryAppender inherits from AppenderSkeleton and I don't see where the requirement for log4net.Appender.IAppender comes from.
Would you be able to share a minimal repro with us?
I'm not quite sure how to go about this. The SentryAppender inherits from AppenderSkeleton and I don't see where the requirement for log4net.Appender.IAppender comes from.
AppenderSkeleton implements IAppender. I'm guessing log4net just needs any old IAppender and AppenderSkeleton is a quick way to wire one of these up without a bunch of boilerplate.
Log4net for my project is provided by Sitecore so it maybe this implementation that makes the error.
I don't think i can share a project since it would require a license for Sitecore.
I will try to debug this some more at this end and report my findings.
I will try to debug this some more at this end and report my findings.
Something that you might be able to test is whether you have the same issue if specifying the configuration in C# (rather than XML). If you don't, that would indicate a problem with the XML configuration.
Package
Sentry.Log4net
.NET Flavor
.NET
.NET Version
4.8.0
OS
Windows
SDK Version
4.6.0
Self-Hosted Sentry Version
No response
Steps to Reproduce
Expected Result
No error during initialization.
Actual Result
The text was updated successfully, but these errors were encountered: