-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Can't get logging to console to work
PostPosted: Wed Jan 18, 2006 9:20 am 
Regular
Regular

Joined: Tue Jan 03, 2006 11:43 am
Posts: 51
Location: Sweden
I can't get the logging to console (this is called output in Visual Studio 2005 right?) to work. It works for the log file, but not for console.

In web.config I have this:

Code:
  <log4net debug="false">

    <!-- Define some output appenders -->
    <appender name="trace" type="log4net.Appender.TraceAppender, log4net">
      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>

    <appender name="console" type="log4net.Appender.ConsoleAppender, log4net">
      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>

    <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net" >

      <param name="File" value="log.txt" />
      <param name="AppendToFile" value="false" />
      <param name="RollingStyle" value="Date" />
      <param name="DatePattern" value="yyyy.MM.dd" />
      <param name="StaticLogFileName" value="true" />

      <layout type="log4net.Layout.PatternLayout,log4net">
        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
      </layout>
    </appender>

    <!-- Setup the root category, add the appenders and set the default priority -->

    <root>
      <priority value="ALL" />     
      <appender-ref ref="rollingFile" />     
      <appender-ref ref="console" />     
    </root>

    <logger name="NHibernate.Cache">
      <level value="DEBUG" />
    </logger>

    <logger name="NHibernate.Impl.BatcherImpl">
      <level value="WARN" />
    </logger>

    <logger name="NHibernate.SQL">
      <level value="ALL" />
    </logger>
  </log4net> 


In Application_Start I have:
log4net.Config.XmlConfigurator.Configure();

What do I do wrong?

/Carl


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 9:34 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
I think Output in VS.NET is trace, not console, but I might be wrong... Also, somewhere in the options there was a switch to enable capturing output to quick console, maybe it will help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 10:27 am 
Regular
Regular

Joined: Tue Jan 03, 2006 11:43 am
Posts: 51
Location: Sweden
Thanks a lot!
Adding <appender-ref ref="trace"> to the root tag did the trick.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.