
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
libranet-logging
Advanced tools
Install via pip:
> bin/pip install libranet-logging
Or add to your poetry-based project:
> poetry add libranet-logging
Logfiles are your best-friend
during development, where debugmode is developmentmode
more important: while running in PRD,
most important: during urgent troubleshooting on PRD (AKA panic-mode)
Make it as easy as possible to enable and properly use the full power of the python logging-framework
python logging-module contains:
Think of logger=message-channel, handler=subscriber to a channel
Minimize the need to make changes in code
Move all config out of code and into a config-file "logging.yml"
logging to a file should be as simple as:
```python
>>> import logging
>>> logging.getLogger('panicmode')
```
You can use following env-variables:
- LOGGING_YML_FILE, path to logging.yml, e.g /opt/miniconda/envs/libranet/etc/logging.yml
- LOG_DIR, path to log-directory where logfiles will be created, /var/tmp/python
- PYTHON_ENABLE_LOGGING_TREE 1|0
optional env-vars: - LOGLEVEL_ROOT - LOGLEVEL_libranet_logging - LOG_HANDLERS="console|debug_file|info_file|warning_file|error_file"
If missing, these default to DEBUG
To initialize the logging-infrastructure and set-up all configured loggers, handlers, formatters and filters:
> import libranet_logging
> libranet_logging.initialize()
2018/06/01 10:00:00 - root - DEBUG - Logging configured from <path-to>/logging.yml
You do this once in your application, in the function that starts execution, not at the top of your module.
# Calling getLogger without arguments returns the root-logger,
# of which all other loggers descend.
# Normally you do NOT need this logger.
> import logging
> root_log = logging.getLogger()
# You normally use the module-logger
> log = logging.getLogger(__name__)
# and starting using it
> log.debug('This is debugging-information.')
> log.info('This is useful information.')
> log.warning('This is a warning.')
> log.error('This is a warning.')
# You can log a full-traceback by providing the exception to log.exception().
> try:
> import foo
> except ImportError as e:
> log.exception(e)
load logging-configuration from a yaml-config
validate yaml-file for missing keys, invalid values
configurable via env-variables
when logging to console, have colorized logging,
integrate python-warnings
add sample email-logger
add sample syslog-logger
avoid empty files that will remain empty
future ideas:
integrate with kibana
log as json, structlog
in code throw out all
formatting,
handler-config,
setting loglevel
debug-flags like::
>>> if DEBUG:
>>> log.debug(....)
FAQs
Easy-to-use logging-configuration using a logging.yml-file
We found that libranet-logging demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.