Skip to content

Logmectl

Eduard Mishkurov edited this page May 17, 2026 · 5 revisions

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.


Command line help

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.


Examples

The examples below assume that the application started a logme control server on port 7791, as shown by the DynamicControl example.

Show server-side help

logmectl -p 7791 help

What happens:

  • logmectl connects to 127.0.0.1:7791
  • it sends the help command
  • 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.

Request JSON response format

logmectl -p 7791 --format json subsystem

What 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

Add a console backend to a channel

logmectl -p 7791 backend --channel ch1 --add console

What happens:

  • the command targets channel ch1
  • a console backend is added at runtime
  • subsequent messages routed to that channel can be printed to the console without restarting the application

Enable or disable a channel

logmectl -p 7791 channel --disable ch1
logmectl -p 7791 channel --enable ch1

What 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

Work with subsystem filters

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 s1

What happens:

  • subsystem prints the current blocked and allowed subsystem lists
  • --block s1 suppresses messages tagged with subsystem s1
  • --unblock s1 removes s1 from the blocked list
  • --allow s2 adds s2 to the allowed list
  • --disallow s2 removes s2 from the allowed list
  • --check s1 shows whether s1 is 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 --clear

Work with trace points

logmectl -p 7791 trace list '*:*:*'
logmectl -p 7791 trace enable '*WorkerLoop*'
logmectl -p 7791 trace stat '*WorkerLoop*'
logmectl -p 7791 trace reset '*WorkerLoop*'
logmectl -p 7791 trace disable '*WorkerLoop*'

What happens:

  • trace list shows registered trace points and hit counters
  • trace enable starts emitting log records from matching trace points
  • trace stat shows the current counters
  • trace reset clears counters for matching trace points
  • trace disable returns matching trace points to silent counter-only mode

Trace point patterns match file:function:line and support * and ? wildcards. See Trace Points.

Browse and read logs

logmectl -p 7791 logs --info
logmectl -p 7791 logs --tree
logmectl -p 7791 logs --tree logs
logmectl -p 7791 logs --read logs/app.log 0 65536
logmectl -p 7791 logs --tail logs/app.log 262144
logmectl -p 7791 logs --download logs/app.log

What happens:

  • logs --info shows the target process home directory and allowed log extensions
  • logs --tree lists folders and matching log files under the home directory
  • logs --read reads a bounded byte range from the selected file
  • logs --tail reads the end of a file
  • logs --download returns the file as base64 for tools such as logmeweb

The command is read-only and does not expose arbitrary server paths. It only works with files below the target home directory and with extensions allowed by the target configuration.

Connect to another host or use TLS

logmectl --ip 192.168.1.10 --port 7791 --ssl --pass secret help

What 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

See also

Clone this wiki locally