-
Notifications
You must be signed in to change notification settings - Fork 3
Logmectl
logmectl is the command-line client for the logme control server. It connects to a running process and sends runtime control commands: listing state, changing channel settings, changing levels, managing backends, and updating subsystem filters.
logmectl - control a running logme instance
Copyright (c) EFM Software
Usage:
logmectl -p <port> [-i <ip>] [--ssl] [--pass <password>] [--format text|json] <command...>
Options:
-p, --port PORT Connect to PORT
-i, --ip IP Connect to IP address (default: 127.0.0.1)
-s, --ssl Use TLS connection
--pass PASSWORD Send control password
--format text|json Response format
-h, --help Show this help
Run with "help" to see available commands.
If no command is specified after the connection options, the client sends help to the server.
The examples below assume that the application started a logme control server on port 7791, as shown by the DynamicControl example.
logmectl -p 7791 helpWhat happens:
-
logmectlconnects to127.0.0.1:7791 - it sends the
helpcommand - the running application returns the list of commands supported by its embedded control server
This is the first command to run when checking which runtime controls are available in the current build.
logmectl -p 7791 --format json subsystemWhat happens:
- the client asks the server to return the response in JSON format
- internally the command is sent as
format json subsystem - this is useful for scripts that need to parse the control-server response
logmectl -p 7791 backend --channel ch1 --add consoleWhat happens:
- the command targets channel
ch1 - a
consolebackend is added at runtime - subsequent messages routed to that channel can be printed to the console without restarting the application
logmectl -p 7791 channel --disable ch1
logmectl -p 7791 channel --enable ch1What happens:
- the first command disables channel
ch1 - the second command enables it again
- this can be used to reduce logging noise while debugging a running process
logmectl -p 7791 subsystem
logmectl -p 7791 subsystem --block s1
logmectl -p 7791 subsystem --unblock s1
logmectl -p 7791 subsystem --allow s2
logmectl -p 7791 subsystem --disallow s2
logmectl -p 7791 subsystem --check s1What happens:
-
subsystemprints the current blocked and allowed subsystem lists -
--block s1suppresses messages tagged with subsystems1 -
--unblock s1removess1from the blocked list -
--allow s2addss2to the allowed list -
--disallow s2removess2from the allowed list -
--check s1shows whethers1is currently blocked or allowed
The blocked list has priority. When the allowed list is not empty, only listed subsystems are logged, unless they are also blocked. Messages without a subsystem are not affected by subsystem filtering.
You can also clear the subsystem lists explicitly:
logmectl -p 7791 subsystem --clear-blocked
logmectl -p 7791 subsystem --clear-allowed
logmectl -p 7791 subsystem --clearlogmectl --ip 192.168.1.10 --port 7791 --ssl --pass secret helpWhat happens:
- the client connects to
192.168.1.10:7791 - TLS is used for the connection
- the password is sent to the control server before executing the command
logme — flexible runtime logging system
Home · Getting Started · Architecture · Output · Backends · Configuration
GitHub: https://github.com/efmsoft/logme
- Home
- Getting Started
- Why logme?
- Core Concepts
- Logging Macros
- Fatal Handling
- Crash Logging
- glog Compatibility
- C API
- Choosing Logging Macros
- Function tracing
- Trace Points
- Override Scopes
- Advanced Features
- Collapse Logging
- Feature Map
- Overview
- Console Backend
- Debugger Backend
- File Backend
- File Rotation & Retention
- Buffer Backend
- Ring Buffer Backend
- SharedFile Backend
- Callback Backend
- Windows Event Log Backend
- Custom Backends
- Runtime Control
- Configuration
- Configuration JSON
- Control Server
- Environment Control
- Control Policies
- Trace Points
- Message Filtering