Skip to content

Logging system metrics#

The following is logged automatically by default:

  • Hardware consumption (CPU, GPU, and memory)
  • Console logs (stdout, stderr)

You'll find these in the monitoring namespace of each run.

How to disable

To turn off logging of system metrics, use one or more of the following parameters with init_run():

run = neptune.init_run(
    capture_hardware_metrics=False,
    capture_stdout=False,
    capture_stderr=False,
)

See in Neptune 

Logging Python Logger output#

You can also capture logs from a Python Logger .

Create and add a Neptune handler to your Logger:

import logging
from neptune.new.integrations.python_logger import NeptuneHandler

logger = logging.getLogger("my_python_logger")

logger.addHandler(NeptuneHandler(run=run))  # a previously initialized run

logger.debug("Starting training")

Tip

You can customize what level of logs you want to capture or the name of the field where the logs will be stored.

For details, see API referencePython Logger.