---
title: "Infrastructure Agent - Customizing logging"
description: "Infrastructure Agent logging can be customized by modifying options like maxBytes, backupCount, filename, and encoding in YAML configuration files. Linux uses syslog by default, while Windows and Linux file logging allow direct control over log rotation and file settings."
url: "https://docs.itrsgroup.com/docs/faq/opsview/14212454856477-opsview-infrastructure-agent-customizing-logging/index.html"
---
The Infrastructure Agent has a few customizable options with regards to file logging.

On a Linux host, the default logging handler is `syslog`, so most options will be determined by the system-wide configuration.

On Windows hosts, or on Linux hosts where you decide to use the `file` logging handler instead of `syslog`, there are the following options you can change by editing the YAML files in the **cfg** subdirectory :

- **maxBytes**: Maximum size of a logfile before it is rotated. The default is `1048576` (1MB)
- **backupCount**: Number of rotated files kept before deletion. The default is `4`.
- **filename**: Name of logfile. The default is C:\Program Files\Infrastructure Agent\logs\agent.log on Windows.
- **encoding**: Character encoding used in the logfiles. The default is `utf-8`.

## Example

```
logging:
  handlers:
    file:
      backupCount: 10
      maxBytes: 2097152
```

This will increase the maximum logfile size to 2MB, and backups to 10.


