---
title: "Collecting logs from chroot"
url: "https://axoflow.com/docs/axosyslog-core/4.28/chapter-examples/example-chroot/"
last_modified: "2023-10-29T10:33:17+01:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/4.28/llms.txt).

# Collecting logs from chroot

## Purpose:

To collect logs from a chroot using an AxoSyslog client running on the host, complete the following steps:

![Collecting logs from chroot](https://axoflow.com/docs/axosyslog-core/4.28/chapter-examples/example-chroot/fig-chroot01_hu_cc4b789fa3cf9946.webp)

## Steps:

1. Create a `/dev` directory within the chroot. The applications running in the chroot send their log messages here.
2. Create a local source in the configuration file of the AxoSyslog application running outside the chroot. This source should point to the `/dev/log` file within the chroot (for example, to the `/chroot/dev/log` directory).
3. Include the source in a log statement.

   > **Note:**
   > You need to set up timezone information within your chroot as well. This usually means creating a symlink to `/etc/localtime`.

Last modified October 29, 2023: [Moves figures to local directories because they weren't displayed in production (247ee161)](https://github.com/axoflow/axosyslog-core-docs/commit/247ee161cb265c6587c6f444f3b3b49809747b0d)
