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

Ron Grabowski commented on LOG4NET-152:
---------------------------------------

This ticket was marked as Invalid because there wasn't a major defect in the 
log4net code. The log4net bug tracking system is not designed to be a general 
support area. There are two mailing lists for helping users and developers of 
log4net. Believe it or not its rather difficult to diagnose why a 50+ line 
snippet of xml just doesn't work. I looked at your xml and made a guess why it 
wasn't working. Yes, my guess was totally incorrect...that's one of the risks 
one takes when making a guess. Without a stack trace, an error message, and 
little knowledge of your environment what should I have guessed? The part about 
running in Medium Trust was a rather large detail to leave out. Medium Trust is 
tricky...especially for 3rd party libraries. If you want to update the 
documentation and provide a patch explaining some of the nuances with log4net 
in Medium Trust and Low Trust environments I'll gladly commit it for the 
benefit of everyone. Remember, you're getting free support for a free software 
package. You'll get more free support (not only from me but from other log4net 
users) on the mailing lists. 

The connectionString property was recently added to log4net and will be 
available in the next release.

The next version of log4net will also make it easier to capture configuration 
errors. The syntax hasn't been finalized but will most likely look very similar 
to this:

 ICollection configurationMessages = XmlConfigurator.Configure();
 for (int i=0;i<configurationMessages.Count;i++)
 {
  Response.Write(configurationMessages[i].ToString() + "<br />");
 }

We have a number of open issues before the next version is released. I look 
forward to your contributions in getting those issues resolved. Your help is 
appreciated!

> getting AsoNetAppender to work
> ------------------------------
>
>                 Key: LOG4NET-152
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-152
>             Project: Log4net
>          Issue Type: Improvement
>    Affects Versions: 1.2.10
>         Environment: windows asp.net c#
>            Reporter: m
>
> I've been trying to get log4net to work with asp.net 2.0 and a database 
> table. Here is the config file:
> <configSections>
> <section name="log4net" 
> type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
> </configSections>
> <log4net>
> <appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
> <bufferSize value="1" />
> <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, 
> Version=1.2.10.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
> <connectionString value="server=CJISDEVSQL01;database=EventLog;integrated 
> security=true;" />
> <commandText value="exec LD80Event_CREATE @eventDate, @logLevel, @message, 
> @exception, @updateUserName" />
> <parameter>
> <parameterName value="@eventDate" />
> <dbType value="DateTime" />
> <layout type="log4net.Layout.RawTimeStampLayout" />
> </parameter>
> <parameter>
> <parameterName value="@logLevel" />
> <dbType value="String" />
> <size value="512" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%p" />
> </layout>
> </parameter>
> <parameter>
> <parameterName value="@message" />
> <dbType value="String" />
> <size value="4000" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%m" />
> </layout>
> </parameter>
> <parameter>
> <parameterName value="@exception" />
> <dbType value="String" />
> <size value="4000" />
> <layout type="log4net.Layout.ExceptionLayout" />
> </parameter>
> <parameter>
> <parameterName value="@updateUserName" />
> <dbType value="String" />
> <size value="50" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%p" />
> </layout>
> </parameter>
> </appender>
> <logger name="eventLog">
> <level value="ALL" />
> <appender-ref ref="AdoNetAppender" />
> </logger>
> <root>
> <level value="ALL" />
> <appender-ref ref="AdoNetAppender" />
> </root>
> </log4net>
> This is the line of code in Global.asax, Application_Start method:
> log4net.Config.XmlConfigurator.Configure();
> This is in the default page:
> private static readonly ILog eventLog = 
> LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
> The issue is all the properties are 'always' set to false when the 
> application is running and 'nothing' is ever written to the database. I have 
> been searching the web for a week now and I can not find any information that 
> has made a difference.
> Can you help with this problem?
> Thank you. 

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

Reply via email to