Logs¶
Where are the adapter logs stored locally?¶
Logs generated by mp-test
or mp-build
are stored in the logs
subdirectory of the
project.
Where are the adapter logs stored in VMware Aria Operations?¶
Logs are generated and stored on the cloud proxy where the adapter is running at
$ALIVE_BASE/user/log/adapters/<ADAPTERKEY>/<ADAPTER_INTERNAL_INSTANCE_ID>
.
ADAPTERKEY
should match the adapter key used in the manifest.txt
, and the ADAPTER_INTERNAL_INSTANCE_ID
should
match the Internal ID
found in VMware Aria Operations at Environment → Inventory → Adapter Instances →
<ADAPTER_DISPLAY_NAME> → <ADAPTER_INSTANCE> in the rightmost column.
The Internal ID
column is not displayed by default. To display the Internal ID, enable the Internal ID
column by
clicking the lower left 'column' icon and then checking the Internal ID
box.
What are the different log files used for?¶
There are five types of log files: adapter, server, build, test, and validation logs. Each log file is prepended with the type of log file followed by a number that represents rollover.
-
server.log
: Contains all logs related to the HTTP server inside the container. Server logs can't be modified since the server code comes packaged inside the base-adapter Python image. -
adapter.log
Contains all logs related to the adapter. Adapter logs are all the logs generated by adapter code (e.g., the test() method or the collect() methods insideapp/adapter.py
). -
test.log
Contains all logs related tomp-test
. -
build.log
Contains all logs related tomp-build
. -
validation.log
Contains a log of the validations performed bymp-test
on the collection results. Validation logs are only generated locally.
How do I add logs to my adapter?¶
The template adapter defines a logger variable in the adapter.py
file that configures all adapter logging using
adapter_logging from the Python SDK.
The logger only needs to be configured once; to generate logs in other files, simply import the Python logging module. Eg.
Adapter logging is setup via the Setup Logging method
available through the AdapterLogger
class of the Java Integrations SDK. The logger only need to be set up once.
To retrieve the logger, you can call the Get Logger
static method:
How do I change the server and/or adapter log level?¶
You can set the log levels for the server and adapter inside the loglevels.cfg
file,
which is located in logs/loglevels.cfg
locally and on the cloud proxy
at $ALIVE_BASE/user/log/adapters/<ADAPTERKEY>/<ADAPTER_INTERNAL_INSTANCE_ID>/loglevels.cfg
.
If the file does not exist, the system generates it after a collection/test.
ADAPTERKEY
should match the name of the adapter used in the manifest.txt
, and the ADAPTER_INTERNAL_INSTANCE_ID
should match the Internal ID
found in VMware Aria Operations at Environment → Inventory → Adapter Instances →
<ADAPTER_DISPLAY_NAME> → <ADAPTER_INSTANCE> in the rightmost column.
The Internal ID
column is not displayed by default. To display the Internal ID, enable the Internal ID
column by
clicking the lower left 'column' icon and then checking the Internal ID
box.
How do I change the log level of mp-init, mp-test, or mp-build?¶
All SDK tools read the LOG_LEVEL environment variable to set the log level of their console output. For example, to set the log level of any of the CLI tools, we can set the LOG_LEVEL variable to the desired log level:
The SDK CLI tools support debug
, warn
, info
, and error
levels.