
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
golangorg/logkit
Advanced tools
Lightweight PHP logging helpers with optional CLI output.
composer require golangorg/logkit
The package autoloads func/log.php and src/config.php, so the logging helpers are available after Composer autoload is loaded.
<?php
use LSS\Config;
Config::set('log', 'file', __DIR__ . '/app.log');
Config::set('log', 'level', LOG_INFO);
write_log('Application started');
write_log('Something worth noting', LOG_NOTICE);
write_log('Something went wrong', LOG_ERROR);
When running in CLI mode, each log line is also echoed to stdout unless you define LOG_QUIET before calling write_log().
Default configuration:
$config['log']['level'] = LOG_INFO;
$config['log']['file'] = false;
$config['log']['format'] = '[%s] %s - %s';
$config['log']['date_format'] = 'm/d/Y g:i:sA';
log.level: highest log level that will be written. Messages above this level are ignored.log.file: path to the log file. If set to false, file logging is disabled.log.format: sprintf() format string with placeholders for log level, date, and message, in that order.log.date_format: date format passed to PHP's date() function.LOG_ERRORLOG_WARNLOG_NOTICELOG_INFOLOG_DEBUGwrite_log($msg, $level = LOG_INFO)Writes a formatted log message to the configured log file.
$msg: message to write.$level: one of the log level constants listed above.null when the message is skipped.close_log_file()Closes the active log file handle. In normal use this is also registered automatically on shutdown after the first write.
FAQs
Logging functions, also handles CLI output
We found that golangorg/logkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.