<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8791420644932489261</id><updated>2024-10-09T03:51:47.732+02:00</updated><category term=".net"/><category term="log4net"/><category term="programming"/><category term="wpf"/><title type='text'>Roman&#39;s blog</title><subtitle type='html'>Human knowledge belongs to the world.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rbetik.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8791420644932489261/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rbetik.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Roman Betík</name><uri>http://www.blogger.com/profile/00129453851290643954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7nQyBTbhSE4R8DrD-7Aloq1ZO4osc4q3P_HMdeGU4soVVxx46sn_va5B94CEYztLtVCJM0ITbXBT3bPHp5oqR9jQeyMeg560ATorieCGg6c5QqIKkdH2jw4A5zD3_7A/s220/fb_xx.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8791420644932489261.post-5638949229125381233</id><published>2010-03-13T19:43:00.002+01:00</published><updated>2010-03-13T19:46:19.474+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="wpf"/><title type='text'>Fluent Ribbon Control Suite</title><content type='html'>&lt;span xmlns=&#39;&#39;&gt;&lt;p&gt;Fluent Ribbon Control Suite is a free ribbon control for your WPF applications. You can find more information about this great control on &lt;a href=&#39;http://fluent.codeplex.com/&#39;&gt;codeplex&lt;/a&gt;.&lt;/p&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://rbetik.blogspot.com/feeds/5638949229125381233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rbetik.blogspot.com/2010/03/fluent-ribbon-control-suite.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8791420644932489261/posts/default/5638949229125381233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8791420644932489261/posts/default/5638949229125381233'/><link rel='alternate' type='text/html' href='http://rbetik.blogspot.com/2010/03/fluent-ribbon-control-suite.html' title='Fluent Ribbon Control Suite'/><author><name>Roman Betík</name><uri>http://www.blogger.com/profile/00129453851290643954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7nQyBTbhSE4R8DrD-7Aloq1ZO4osc4q3P_HMdeGU4soVVxx46sn_va5B94CEYztLtVCJM0ITbXBT3bPHp5oqR9jQeyMeg560ATorieCGg6c5QqIKkdH2jw4A5zD3_7A/s220/fb_xx.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8791420644932489261.post-6144836091788848713</id><published>2010-02-05T22:21:00.045+01:00</published><updated>2010-02-06T09:23:14.707+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="log4net"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Simple guide for log4net</title><content type='html'>&lt;div&gt;log4net is a tool that can help you log almost anything from your .NET applications to various places like text files, console, event log or you can even log through the network. The power of this solution is not only where you can log but it is the way you set up that logging. This text is intended as a brief and short information on how to set up and use log4net. So let&#39;s go.&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;Usually you set up log4net using the app.config (or web.config) or any other configuration file you use. The first thing you need to do is to add a section to your configuration, something like this:&lt;/div&gt;&lt;pre class=&quot;xml&quot; name=&quot;code&quot;&gt;&amp;lt;section name=&quot;log4net&quot; type=&quot;log4net.Config.Log4NetConfigurationSectionHandler, log4net&quot; /&amp;gt;&lt;/pre&gt;&lt;div&gt;Then add the section for log4net:&lt;/div&gt;&lt;pre class=&quot;xml&quot; name=&quot;code&quot;&gt;&amp;lt;log4net debug=&quot;true&quot;&amp;gt;
  &amp;lt;appender name=&quot;RollingLogFileAppender&quot; type=&quot;log4net.Appender.RollingFileAppender&quot;&amp;gt;
    &amp;lt;file value=&quot;BigXmlReader.log&quot; /&amp;gt;
    &amp;lt;appendToFile value=&quot;true&quot; /&amp;gt;
    &amp;lt;rollingStyle value=&quot;Size&quot; /&amp;gt;
    &amp;lt;maxSizeRollBackups value=&quot;10&quot; /&amp;gt;
    &amp;lt;maximumFileSize value=&quot;10MB&quot; /&amp;gt;
    &amp;lt;staticLogFileName value=&quot;true&quot; /&amp;gt;
    &amp;lt;lockingModel type=&quot;log4net.Appender.FileAppender+MinimalLock&quot; /&amp;gt;
    &amp;lt;layout type=&quot;log4net.Layout.PatternLayout&quot;&amp;gt;
      &amp;lt;conversionPattern value=&quot;%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n&quot; /&amp;gt;
    &amp;lt;/layout&amp;gt;
  &amp;lt;/appender&amp;gt;

  &amp;lt;appender name=&quot;ConsoleAppender&quot; type=&quot;log4net.Appender.ConsoleAppender&quot;&amp;gt;
  &amp;lt;layout type=&quot;log4net.Layout.PatternLayout&quot;&amp;gt;
    &amp;lt;conversionPattern value=&quot;%date [%thread] %-5level %logger [%property{NDC}] - %message%newline&quot; /&amp;gt;
  &amp;lt;/layout&amp;gt;
  &amp;lt;/appender&amp;gt;

  &amp;lt;appender name=&quot;OutputDebugStringAppender&quot; type=&quot;log4net.Appender.OutputDebugStringAppender&quot; &amp;gt;
  &amp;lt;layout type=&quot;log4net.Layout.PatternLayout&quot;&amp;gt;
    &amp;lt;conversionPattern value=&quot;%date [%thread] %-5level %logger [%property{NDC}] - %message%newline&quot; /&amp;gt;
  &amp;lt;/layout&amp;gt;
  &amp;lt;/appender&amp;gt;

  &amp;lt;root&amp;gt;
    &amp;lt;level value=&quot;DEBUG&quot; /&amp;gt;
    &amp;lt;appender-ref ref=&quot;ConsoleAppender&quot; /&amp;gt;
    &amp;lt;appender-ref ref=&quot;OutputDebugStringAppender&quot; /&amp;gt;
    &amp;lt;appender-ref ref=&quot;RollingLogFileAppender&quot; /&amp;gt;
  &amp;lt;/root&amp;gt;
&amp;lt;/log4net&amp;gt;&lt;/pre&gt;&lt;div&gt;Now you are ready to use log4net in your application. In order to do it, you need to add a reference to log4net.dll and start the log4net. You can do it by calling this&lt;/div&gt;&lt;pre class=&quot;c#&quot; name=&quot;code&quot;&gt;log4net.Config.XmlConfigurator.Configure();&lt;/pre&gt;&lt;div&gt;anywhere at the start of your application so that it is possible to use log4net anywhere in your code. The last thing you need to do is to declare a logger in your class:&lt;/div&gt;&lt;pre class=&quot;c#&quot; name=&quot;code&quot;&gt;private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);&lt;/pre&gt;&lt;div&gt;and then use it anywhere you need to log some event. There are several priorities which you can log with. There are debug, info, warn, error and fatal levels. Use appropriate methods on the log instance. For instance:&lt;/div&gt;&lt;pre class=&quot;c#&quot; name=&quot;code&quot;&gt;log.DebugFormat(&quot;Logging {0}&quot;, &quot;something&quot;);&lt;/pre&gt;&lt;div&gt;For detailed information about log4net visit its &lt;a href=&quot;http://logging.apache.org/log4net/index.html&quot;&gt;website&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rbetik.blogspot.com/feeds/6144836091788848713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rbetik.blogspot.com/2010/02/simple-guide-for-log4net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8791420644932489261/posts/default/6144836091788848713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8791420644932489261/posts/default/6144836091788848713'/><link rel='alternate' type='text/html' href='http://rbetik.blogspot.com/2010/02/simple-guide-for-log4net.html' title='Simple guide for log4net'/><author><name>Roman Betík</name><uri>http://www.blogger.com/profile/00129453851290643954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7nQyBTbhSE4R8DrD-7Aloq1ZO4osc4q3P_HMdeGU4soVVxx46sn_va5B94CEYztLtVCJM0ITbXBT3bPHp5oqR9jQeyMeg560ATorieCGg6c5QqIKkdH2jw4A5zD3_7A/s220/fb_xx.jpg'/></author><thr:total>0</thr:total></entry></feed>