How to Create Monitor Logs with Log4net
    • Dark
      Light
    • PDF

    How to Create Monitor Logs with Log4net

    • Dark
      Light
    • PDF

    Article summary

    To troubleshoot effectively, our technical teams might need a detailed log of the ControlUp Monitor. We use log4net as a third-party logger to allow you to log the activity of the monitor in different log levels.

    From ControlUp version 9.0, monitor machines automatically create log files, so you don't need to manually create a log file.

    For pre 9.0 versions, the monitor machines don't automatically create log files, so you still need to manually create a log file.

    Create Log File Automatically (9.0)

    On your monitor machine, start the ControlUp Monitor service. First, it detects if a log4net file exists under the ControlUp Monitor folder C:\Program Files\Smart-X\ControlUpMonitor\Version 9.0.0.xxxx:
    log4net

    If a log4net file exists, all monitor errors will be collected in this folder.

    If no existing log4net is detected under the monitor folder, then the error log is automatically created under the Service Profiles folder C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\ControlUp:
    log4net2

    All monitor errors will be collected in this folder.

    Create Log File Manually (pre 9.0)

    1. On your monitor machine, navigate to the ControlUp Monitor folder C:\Program Files\Smart-X\ControlUpMonitor\Version 8.x.x.xxx
    2. Download and copy the file cuMonitor.exe.log4net to the monitor directory.
    3. Right-click the monitor folder > Security. Add the NETWORK SERVICE user.
      image.png
    4. Assign Full control permission to the NETWORK SERVICE user.
      image.png
    5. You can now see a new file ControlUp.log.
      image.png
      If you want to change the file name you can edit the following value in the cuMonitor.exe.log4net file:
      <file value="ControlUp.log"/>
      

    Settings in Log4net File

    Set the Log Level

    You can set the log level (e.g., DEBUG, ERROR, WARN) by changing the following value.

    <root>
    <level value="DEBUG"/>
    <appender-ref ref="RollingFileAppender"/>
    </root>
    
    Information

    The debug level is a lower log level than the info level. This means that log statements written at the debug level are generally considered to be less important or severe than log statements written at the info level

    Set the Maximum File Size

    To change the file size, modify the value in the maximumFileSize key.

    <maximumFileSize value="50MB"/>
    

    Set Rollback Policy

    Define how many files are written after the maximum file size has been reached. You can find more information here.

    <maxSizeRollBackups value="5"/>
    

    Was this article helpful?