How to change Container logging to the Windows Event Log

14/12/2017 Stuart Moore

By default, Containers log to text files in their current working directory. Containers can be configured to log to the Windows Event Log.

Step-by-step guide

  1. Open Cloudhouse.Container.Deployment.exe.config from the deployment folder.
  2. Use the sample replacement config below.
  3. Change "Cloudhouse AppName" to the desired application name.


<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <configSections>
  <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
 </configSections>
 <startup> 
   <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
 </startup>
 <log4net>
   <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
     <logName value="Application"/>
     <applicationName value="Cloudhouse AppName"/>
     <layout type="log4net.Layout.PatternLayout">
       <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
     </layout>
   </appender>

 <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> 
   <layout type="log4net.Layout.PatternLayout">
     <conversionPattern value="%date %-5level %logger - %message%newline"/>
   </layout>
 
 </appender>
   <root>
    <level value="INFO"/>
    <appender-ref ref="ConsoleAppender"/>
    <appender-ref ref="EventLogAppender"/>
   </root>
 </log4net>
</configuration>

Note: Text in italics indicates changes to the default configuration

Applies To

Cloudhouse Containers

Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support