github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/doc/logging.txt (about) 1 Logging 2 ======= 3 4 The intent of this documentation is to provide an overview of logging 5 in Juju. 6 7 Accessing logs as a user 8 ======================== 9 Please consult the available user documentation for details of how to 10 access Juju's logs. Specifically: 11 12 * https://juju.is/docs/olm/juju-logs 13 * juju help logging 14 * juju help debug-log 15 * juju-dumplogs --help 16 17 Consolidated log infrastructure 18 =============================== 19 All machine and unit agents run a "logsender" worker which sends the 20 agent's logs to a controller using the "logsink" API. The "logsink" 21 API handler writes the received logs to a "logs" collection in the 22 "logs" MongoDB database (via DbLogger in the state package). In a HA 23 model the logs are replicated between controllers using 24 MongoDB's usual replication mechanisms. 25 26 The `juju debug-log` command uses the "logs" API to retrieve 27 logs. This starts by querying the logs.logs collection and then 28 "tails" the replication oplog for further updates to logs.logs. The 29 LogTailer in the state package abstracts away the log querying and 30 tailing mechanics.