# Working with the Log Level

If no custom log level is set, the default log level will be set by the configuration file.

If the Atlas Copco Data Communication service is restarted then all the current log filters will be removed, leaving only the global filter that was set up by the configuration file.

The log level can be changed while Atlas Copco Data Communication is running, by using the Atlas Copco Data Communication Web API.

The following log level system calls are available:

- Endpoint list of all the active log filters

  `GET http://127.0.0.1:7110/DataCommunication/v1/logging`

- Assign a new log level to a specific controller

  `POST http://127.0.0.1:7110/DataCommunication/v1/logging/{logId}/level/{logLevel}`

- Change the global log level for Atlas Copco Data Communication

  `PUT http://127.0.0.1:7110/DataCommunication/v1/logging/global/level/{logLevel}`

- Change the existing log level filter for a controller

  `PUT http://127.0.0.1:7110/DataCommunication/v1/logging/{logId}/level/{logLevel}`

- Reset the log level for the controller. This will revert to use the global log level

  `DELETE http://127.0.0.1:7110/DataCommunication/v1/logging/{logId}`

Log Levels
Log Level | Description
--- | ---
ERROR | Unhandled exceptions.
WARNING | Handled exceptions or other important events that could caus or indicate out of the ordinary application behavior.
INFORMATION | State changes in the application. Useful for managing application (setup information, service start/stop, controller connected/disconnected).
DEBUG | Information that can be used for debugging purposes (variables, method names).
VERBOSE | Similar to DEBUG but also with full object bodies.

## Communication of Log Id and Internet Protocol Address

The IP address can be found on the interface of the controller or in the log file, when it connects to Atlas Copco Data Communication.

Px2 uses a port number which is created when connecting to Atlas Copco Data Communication. You will find the port number in the log file and not in the controller.

Protocol | Log Id
--- | ---
Open Protocol | Controller IP address
Power Focus 4000 | Controller IP address
Px2 | Controller IP address and Port
PowerMACa | Controller IP address
ToolsNet Data Collection Protocol | Controller IP address
ToolsNet Open Protocol | Controller IP address

## Examples of System Calls

- Create a filter of the log level for PowerFocus 4000

  `POST http://127.0.0.1:7110/DataCommunication/v1/logging/127.0.0.1/level/verbose`

- Create a filter of the log level for Px2

  `POST http://127.0.0.1:7110/DataCommunication/v1/logging/127.0.0.1:53069/level/verbose`