NeptuneLoggingHandler
Python package: neptune-scale
A handler that sends the records created by the Python Logger
to Neptune.
Parameters
Name | Type | Default | Description |
---|---|---|---|
run | Run | - | A reference to a Run object which should track the logs. |
level | int | logging.NOTSET | Level of the logs to capture:
|
atribute_path | str , optional | None | Path to the StringSeries attribute that stores the logs. If None , the logs are stored under system/logs . |
Example
from neptune_scale import Run
from neptune_scale import NeptuneLoggingHandler
import logging
run = Run(
api_token="eyJhcGlfYWRkcmVz...In0=",
project="team-alpha/project-x",
)
# Create a logger
logger = logging.getLogger("my_experiment")
# Create a NeptuneLoggingHandler object and add it to the logger
npt_handler = NeptuneLoggingHandler(run=run)
logger.addHandler(npt_handler)
# Log messages
logger.info("Starting data preparation")