systemd-cat
is the equivalent to logger:
echo 'hello' | systemd-cat
In another terminal, running journalctl -f
:
Feb 07 13:38:33 localhost.localdomain cat[15162]: hello
Priorities are specified just by part of the string:
echo 'hello' | systemd-cat -p info
echo 'hello' | systemd-cat -p warning
echo 'hello' | systemd-cat -p emerg
Warnings are bold, emergencies are bold and red. Scary stuff.
You can also use an ‘identifier’ which is arbitrary, to specify the app name. These are like syslog’s old facilities, but you’re not stuck with ancient things like lpr
uucp
nntp
or the ever-descriptive local0
through local7
.
echo 'hello' | systemd-cat -t someapp -p emerg
Is logged as:
Feb 07 13:48:56 localhost.localdomain someapp[15278]: hello
Related Posts:
- IIS: Where can I find the IIS logs?
- How do I convert dmesg timestamp to custom date format?
- Log.INFO vs. Log.DEBUG
- Are there any log file about Windows Services Status?
- How to view snort log files
- Configure Node.js to log to a file instead of the console
- Where is the Docker daemon log?
- Is it possible to run one logrotate check manually?
- Log of Heartbeat Calls
- Custom and browser agent logging in wordpress [closed]
- Logging Count of Those Who Read Whole Post (ie reach the bottom)
- Does WordPress provide different levels of logging?
- Can I hook error_log(…)?
- Debug log file with rolling datestamp in filename?
- how to make a code which save admin each time login and logout activity inside a table
- Make a Docker application write to stdout
- ISO Plugin: Audit Trail with Diff of Content Changes
- Docker System has not been booted with systemd as init system
- python exception message capturing
- Console logging for react?
- How to configure logging to syslog in Python?
- What is the result of making log4j additivity equals to true or false?
- What is the significance of log4j.rootLogger property in log4j.properties file? What happens if I don’t use this property?
- Elasticsearch: Max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
- Adding message to assert
- Python/Django: log to console under runserver, log to file under Apache
- How to easily print ascii-art text?
- How to have ‘git log’ show filenames like ‘svn log -v’
- Retrieve last 100 lines logs
- Retrieve last 100 lines logs
- E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xab7519c0
- E/Surface﹕ getSlotFromBufferLocked: unknown buffer: 0xab7519c0
- Where does linux store my syslog?
- How to write logs in text file when using java.util.logging.Logger
- No handlers could be found for logger
- Swift: print() vs println() vs NSLog()
- Control verbosity level of WP DEBUG?
- How do I log plugin (cron) actions?
- What is the best way to monitor PHP functions/executions?
- How to stop certain warning logging in error.log?
- Core framework/helpers for logging stuff?
- Keep Users Logged In As Long As I Like
- Does the debug.log do log rotation?
- $wpdb->insert Database Error Duplicate Entry Error Logging
- Using separate Apache log files for multisite
- Get WP CLI to hide debug warnings and notices in JSON output, same setting as website
- PHP logging framework to be used with WordPress
- How to dump/log default values that are passed to hooks/filter functions?
- Preferred Method of debugging a wordpress SQL calls?
- Is there a way to see history of WordPress database changes?
- Same log message keeps on printing to debug.log file thousand of times
- buddypress activity social share
- wp_set_current_user (remote logging) doesnt work on server
- How do I show a different homepage to logged in and non-logged in users?
- I restricted wordpress by logged users. It’s possible exclude a page?
- Which data is written and stored in the database when read-only (non-posting, non-commenting) users visit the site?
- Log Author Actions
- Several times request to load plugins when sending one request
- Sidebar button click redirect when user is not logged in instead displays it
- How to catch all PHP errors with custom error handler?
- Debugging – logging database queries
- How to hook into action/filter call
- WordPress + Buddpyress – troubleshooting server overloading
- How can I check if a visitor can read a post?
- Plugin Update History
- My account staying logged when the browser closed
- error log is going to the wrong location, WP_DEBUG_LOG is ignored
- Write/saved logs in WordPress
- WordPress Multisite VMware copy for dev use not allowing loggin
- Debug info from request handler
- Logging search queries for logged-in users
- How to send logs to plugin owner for a plugin?
- search does not yield access restricted results
- Undefined constant error in pluggable.php
- How to set environment variable in systemd service?
- Do systemd unit files have to be reloaded when modified?
- Is my password compromised because I forgot to hit Enter after ssh username?
- How to add a timestamp to bash script log?
- Find the location of a systemd unit file service
- In systemd, what’s the difference between After= and Requires=?
- Does getting disconnected from an SSH session kill your programs?
- Is there a way to see the execution tree of systemd?
- Is there a proper way to clear logs?
- Log all commands run by admins on production servers
- Do you have any useful awk and grep scripts for parsing apache logs? [closed]
- Service start request repeated too quickly, refusing to start limit