Skip to content

Enabling serviced debug logging

You can enable debug messages without restarting serviced.

Enabling all debug messages

To enable debug messages for all of the packages included in serviced, follow these steps:

  1. Log in to the host as root or as a user with superuser privileges.

  2. Toggle debug mode on.

    pkill -f -USR1 /opt/serviced/bin/serviced
    
  3. Display the messages.

    journalctl -o cat -flu serviced
    

To turn off debug messages, repeat step 2.

Enabling debug messages for specific packages

The serviced daemon is written in Go, and many of the packages included in it use logrus logging. One of the features of logrus is the ability to change the logging level for individual packages without restarting the daemon. The daemon watches a configuration file and adjusts levels when the file changes.

To enable debug messages for serviced packages that use logrus logging, follow these steps:

  1. Log in to the Control Center host as root or as a user with superuser privileges.

  2. Open /opt/serviced/etc/logconfig-server.yaml with a text editor.

  3. Modify the logging for the package or packages that interest you.

    For example, to log everything at debug level except RPC requests (which are frequent and might hide useful logs), modify the file as follows:

    - logger: '*'
      level: debug
    - logger: rpc
      level: info
    

    For more package names, see the next section.

  4. Save the file, and then exit the text editor.

  5. Display the messages.

    journalctl -o cat -flu serviced
    

Control Center packages that use logrus logging

The following packages in release 1.5.1 use logrus logging. However, some do not include debug messages, and sometimes, understanding debug messages requires knowledge of the source code.

  • audit
  • auth
  • cli/api
  • cli/cmd
  • config
  • container
  • coordinator/client
  • coordinator/client/zookeeper
  • coordinator/storage
  • dao/elasticsearch
  • datastore/elastic
  • dfs
  • dfs/docker
  • dfs/nfs
  • dfs/ttl
  • domain
  • domain/addressassignment
  • domain/host
  • domain/hostkey
  • domain/logfilter
  • domain/pool
  • domain/properties
  • domain/registry
  • domain/service
  • domain/serviceconfigfile
  • domain/servicedefinition
  • domain/servicetemplate
  • domain/user
  • facade
  • isvcs
  • metrics
  • node
  • proxy
  • rpc
  • rpc/agent
  • rpc/master
  • rpc/rpcutils
  • scheduler
  • scheduler/servicestatemanager
  • script
  • servicedversion
  • shell
  • stats
  • utils
  • utils/iostat
  • web
  • zzk
  • zzk/registry
  • zzk/service