The agent generates two types of logs:
Agent Log
The agent log contains information about the transactions that the agent processes and sends to the downstream agent.
By default, these logs are saved as var/log/nginx/error.log
. You can enable or disable these logs by using the AppDynamicsTraceAsError
in opentelemetry_module.conf
parameter.
The naming convention of the default agent logs are:
error.log
: the current logerror.log.1
: most recent logerror.log.2
: second recent logerror.log.3
: third recent logerror.log.4
: fourth recent logerror.log.5
: fifth recent log
The agent creates and rotates a maximum of six log files. The maximum log file size is 20 MB, which gives you a maximum of 120 MB of recent log data at one time.
Sample Error Log Output
2021/06/17 05:37:22 [error] 25439#25439: Starting Appdynamics Modlue init
2021/06/17 05:37:22 [error] 25439#25439: Registering handlers for modules in different phases
2021/06/17 05:37:22 [error] 25439#25439: Ending Appdynamics Modlue init
CODE
Core Log
The core logs are saved as /opt/opentelemetry-webserver-sdk/logs/sdk.log
and are of three types:
sdk.log
api.log
api-user.log
The naming convention of the default agent logs are:
sdk.log
: the current logsdk.log.1
: most recent logsdk.log.2
: second recent logsdk.log.3
: third recent logsdk.log.4
: fourth recent logsdk.log.5
: fifth log
Similarly, the api.log
and the api-user.log
files are created. The agent creates and rotates a maximum of six log files. The maximum log file size is 20 MB, which gives you a maximum of 120 MB of recent log data for each core log type.
You can edit the <webserver_agent_install_dir>/conf/appdynamics_sdk_log4cxx.xml
file to change the default logging behavior.
When the default log behavior is changed, a service restart is required.
Sample sdk.log Output
2021-06-16 05:14:00.506 UTC INFO 38616[0x7f5d7b535700] [agent.SdkWrapper] ServiceNamespace: electronics ServiceName: e-commerce ServiceInstanceId: 71410b7jan13
2021-06-16 05:14:00.508 UTC INFO 38616[0x7f5d7b535700] [agent.SdkWrapper] Exporter created with ExporterType: otlp
2021-06-16 05:14:00.508 UTC INFO 38616[0x7f5d7b535700] [agent.SdkWrapper] Processor created with ProcessorType: batch
2021-06-16 05:14:00.508 UTC INFO 38616[0x7f5d7b535700] [agent.SdkWrapper] Sampler created with SamplerType : always_on
2021-06-16 05:14:00.508 UTC INFO 38616[0x7f5d7b535700] [agent.SdkWrapper] Tracer created with LibraryName: and LibraryVersion
CODE
Sample Code to Print sdk.log
LOG4CXX_DEBUG(mLogger, "Starting AgentCore with initial Config "<< *initConfig);
CODE