# Logging The EC-Monitor offers a logging interface for a more detailed analysis of application errors, problems in the EtherCAT® network and for diagnosing internal processes. The log messages are passed from the EC-Monitor to the application via the callback [`EC_T_LOG_PARMS::pfLogMsg`](api_general.html.md#_CPPv4N14EC_T_LOG_PARMS8pfLogMsgE) given at [`EC_T_MONITOR_INIT_PARMS::LogParms`](api_general.html.md#_CPPv4N23EC_T_MONITOR_INIT_PARMS8LogParmsE). ### typedef [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) (\*[EC_PF_LOGMSGHK](api_general.html.md#_CPPv414EC_PF_LOGMSGHK))(EC_T_LOG_CONTEXT \*pContext, [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwLogMsgSeverity, const [EC_T_CHAR](api.html.md#_CPPv49EC_T_CHAR) \*szFormat, ...) The level of detail of the logging output can be set via [`EC_T_LOG_PARMS::dwLogLevel`](api_general.html.md#_CPPv4N14EC_T_LOG_PARMS10dwLogLevelE). The log levels are firmly defined: EC_LOG_LEVELS For performance reasons, the log messages are automatically filtered based on the log level and then passed to the callback. **Example** The `EcMonitorDemo` examples demonstrate how log messages can be processed by the application, see `Examples/Common/EcLogging.cpp`. The messages processed by `EcLogging.cpp` are of different types, e.g. EC-Monitor log messages and application messages are logged to the console and/or files. Identical messages are skipped automatically by default. #### NOTE With some operating systems, logging in files is deactivated, e.g. because a file system is not available. The verbosity of the `EcMonitorDemo` is specified as a `-v` command line parameter. It is used to determine the log level of the application, see `EcDemoMain.cpp`. `EcLogging.cpp` has various parameters beside the log level, like Roll Over setting, log task priority, CPU affinity, log buffer size and etc.