Skip to main content

This plugins allows for the configuration of the format of VDK logs.

TEXT

This is the default log format, and is the one which VDK would use if vdk-logging-format is not installed. It is intended to be human-readable; it is not structured in an easy-to-parse way for a machine.

Logs appear in the following format:

2022-11-11 15:22:43,863 [VDK] example-job [INFO ] root                              execution_skip.py:111  _skip_job_if_nec[id:baf3c02e-eef0-4b6f-9abe-438177967621-1668172963-1d1fe]- Local execution, skipping parallel execution check.
2022-11-11 15:22:43,864 [VDK] example-job [INFO ] vdk.internal.builtin_plugins.r   file_based_step.py:102  run_python_step [id:baf3c02e-eef0-4b6f-9abe-438177967621-1668172963-1d1fe]- Entering 10.py#run(...) ...

LTSV

This is a POC level implementation of a plugin which changes the logging format of vdk-core to LTSV for the purposes of structured data visualization.

The new format has the following fields, separated by tabs:

  • timestamp: a timestamp of when the log is made;
  • created: the same timestamp in the unix epoch format;
  • jobname: the name of the data job;
  • level: the logging level - one of INFO, WARNING, DEBUG, ERROR;
  • modulename: the name of the module, inside of which the logging call is made;
  • filename: the name of the file containing the logging call being made;
  • lineno: the number of the line of code, at which the logging call is made;
  • funcname: the name of the function, inside which the loggin call is made;
  • attemptid: string identifying this particular execution of the data job;
  • message: any additional logged information.

The label names follow the labelling recommendations found at http://ltsv.org/.

After configuration, logs will be automatically formatted to LTSV format. They would start to look something like this:

@timestamp:2021-08-04T12:51:11	created:1628070671	jobname:example-job	level:DEBUG	modulename:vdk.internal.trino_connection	filename:managed_connection_base.py	lineno:69	funcname:connect	attemptid:1628070671-452613-739749	message:Established <trino.dbapi.Connection object at 0x10b9b1d30>
@timestamp:2021-08-04T12:51:11	created:1628070671	jobname:example-job	level:DEBUG	modulename:vdk.internal.trino_connection	filename:managed_cursor.py	lineno:29	funcname:execute	attemptid:1628070671-452613-739749	message:Executing query: select 1

JSON

This is a POC level implementation of a plugin which changes the logging format of vdk-core to JSON for the purposes of structured data visualization in a log aggregator.

The new format has the following fields:

  • @timestamp: a timestamp of when the log is made;
  • jobname: the name of the data job;
  • level: the logging level - one of INFO, WARNING, DEBUG, ERROR;
  • modulename: the name of the module, inside of which the logging call is made;
  • filename: the name of the file containing the logging call being made;
  • lineno: the number of the line of code, at which the logging call is made;
  • funcname: the name of the function, inside which the loggin call is made;
  • attemptid: string identifying this particular execution of the data job;
  • message: any additional logged information.

If the log record contains an error, it will also contain the following fields:

  • error.message: the message of the exception;
  • error.stack_trace: a stack trace of the exception;
  • error.type: the type of exception.

The label names follow the labelling recommendations found at http://ltsv.org/. The reason we chose the LTSV naming standard is due to the fact that this plugin was based on a previous LTSV-formatting plugin, as well as the fact that there is no single JSON naming standard.

Additionally, double quote characters within the message are escaped.

After configuration all logs will be automatically formatted to JSON. They will appear like this:

{"@timestamp": "2021-10-14T11:37:44.703Z", "message": "Checking if job should be skipped:", "level": "INFO", "lineno": 102, "filename": "execution_skip.py", "modulename": "vdk.plugin.control_cli_plugin.execution_skip", "funcname": "_skip_job_if_necessary", "jobname": "gg-job4", "attemptid": "1634211464-1ee897-a3f0eb"}```

Usage

Installing the plugin:

pip install vdk-logging-format

After, configure the log format by setting the LOGGING_FORMAT configuration variable to JSON or LTSV.

Metadata

Release files for vdk-logging-format 0.1.693820748

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vdk-logging-format 0.1.693820748
File Size Uploaded
vdk-logging-format-0.1.693820748.tar.gz 4.1 kB Details

Release files / vdk-logging-format-0.1.693820748.tar.gz

Download URL vdk-logging-format-0.1.693820748.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7f000a65082c82f8eeaa34e943df04a3e862f56b0834be7876157e5de5ae0276
BLAKE2b-256 checksum
How to use checksums
738049057712c28fbd5ab6119a4784b3c83d31da4a448f4733b202a7cb5b8515
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.15
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page