extradata
HostnameField
¶
Bases: DataProvider
Finds the hostname and adds it to the LogRecord as hostname
Source code in src/loggext/extradata/hostname.py
ProgramNameField
¶
Bases: DataProvider
Selects a suitable program-name and adds it to the LogRecord as programName
Source code in src/loggext/extradata/program_name.py
ShortNameField
¶
Bases: DataProvider
Shortens the name of the current logger and adds it to the LogRecord as shortName
.
This can heavily decrease the size of your log-files in exchange for losing some clarity.
Example
project.custom.module
-> p.c.module
Source code in src/loggext/extradata/short_name.py
UsernameField
¶
Bases: DataProvider
Finds the username and adds it to the LogRecord as username
Info
On UNIX systems this uses the :mod:pwd
module which means root
will
be reported when :man:sudo
is used (as it should). If this fails (for
example on Windows) then :func:getpass.getuser()
is used as a fallback.