Skip to main content

I followed this article about Basic Logging Configuration, however after a while the K2 folder was crammed with log files that consumed a considerable disk space C: drive where K2 is installed. 


I intentionally chose to keep those logs as keeping them is a requirement, however I don't was losing space on the C: drive, is there a way to change the location of the Host Server logs?


another question: what are the types of logs that I can have other than SmartObject & Host Server Logs?

First off, I would recommend setting the logging to only include errors, This should reduce the amount of space occupied by the log files. The following is a good post on this topic:


http://www.k2underground.com/blogs/johnny/archive/2007/10/06/how-do-i-use-logging-in-k2-blackpearl.aspx


To answer your question, the HostServerLogging,config file discussed in the post above has a node called LogFilePath. By default it's empty but adding a valid path in there will change the default location the log is created in.


 


Finally, those two types of logs are the biggest ones one should care about. There is also a log file for the AD User Manager (starts with ADUMError), written in the Host Server/bin directory.


To answer your question, the HostServerLogging,config file discussed in the post above has a node called LogFilePath. By default it's empty but adding a valid path in there will change the default location the log is created in.

Do you mean it is an attribute like below:


<ApplicationLevelLogSettings>
 <ApplicationLevelLogSetting Scope="Default">
  <LogLocationSettings>
   <LogLocation Name="ConsoleExtension" Active="True" LogLevel="Debug"   
LogFilePath="drive:NewPATH"/>


   <LogLocation Name="FileExtension" Active="False" LogLevel="Debug"  LogFilePath="drive:NewPATH"/>


   <LogLocation Name="EventLogExtension" Active="False" LogLevel="Debug"  LogFilePath="drive:NewPATH"/>


   <LogLocation Name="ArchiveExtension" Active="False" LogLevel="Debug" LogFilePath="drive:NewPATH"/>


 


or a Tag like this:


<ApplicationLevelLogSettings>
 <ApplicationLevelLogSetting Scope="Default">
  <LogLocationSettings>


<LogFilePath>drive:NewPATH</LogFilePath>


   <LogLocation Name="ConsoleExtension" Active="True" LogLevel="Debug" />
   <LogLocation Name="FileExtension" Active="False" LogLevel="Debug" />
   <LogLocation Name="EventLogExtension" Active="False" LogLevel="Debug" />
   <LogLocation Name="ArchiveExtension" Active="False" LogLevel="Debug" />




    <Extension Name="FileExtension" type="SourceCode.Logging.Extension.FileExtension">
      <Property Name="LogFileName" value="HostServer.log"/>
      <Property Name="LogFilePath" value="" />
      <Property Name="HashAlgorithm" value="CRC32" />
      <Property Name="MaxFileSizeKB" value="5000" />
      <Property Name="MaxLifetimeSpan" value="7:0:0:00" />
    </Extension>


Reply