# Where does Discourse store and show logs?

**URL:** https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022
**Category:** Self-Hosting
**Tags:** reference
**Created:** [February 27, 2017, 3:56pm UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022 "2017-02-27T15:56:29Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [February 27, 2017, 3:56pm UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/1 "2017-02-27T15:56:29Z")

</div>

When troubleshooting issues or errors with Discourse it is important you look at your logs. Here’s a listing of where they are and what’s in there.

 

Your site domain

## Administration logs shown in the UI

The Discourse admin panel contains several forms of logging:

- Emails that are sent, skipped, bounced, received and rejected are logged at https://=DOMAIN=/admin/email-logs and the neighboring tabs.
- Staff actions are logged at https://=DOMAIN=/admin/logs/staff\_action\_logs
- Email addresses and IP addresses that have been banned from registration will be listed at https://=DOMAIN=/admin/logs/screened\_emails and https://=DOMAIN=/admin/logs/screened\_ip\_addresses
- Links posted by accounts that have been banned as spammers are listed at https://=DOMAIN=/admin/logs/screened\_urls
- Search analytics logs are shown at https://=DOMAIN=/admin/logs/search\_logs

## The Logster web UI

Every Discourse instance ships with a GUI log viewer. It is located at: https://=DOMAIN=/logs

 ![](https://global.discourse-cdn.com/meta/original/3X/b/9/b90477a0fc345daeebd6af4692115a0d8ca41321.png)

Note: if you are on a hosted plan, this page may be hidden from you. Instead, contact support when you’re getting this kind of issue!

If you’re investigating a mysterious 500 error on the forums, you should always try this spot first!

Select an error line to get details about it. You may be asked to provide the contents of the `env` and `backtrace` tabs here on Meta.

## The Rails / Pitchfork logs

Ruby on Rails contains a very verbose log which is written to disk. Additionally the web server [pitchfork](https://github.com/Shopify/pitchfork) (a fork of unicorn) also logs to disk.

To access:

```plaintext
cd /var/discourse
./launcher enter app
cd /shared/log/rails

```

This folder contains "`production.log`" and "`unicorn.stderr.log`" in addition to "rotated" log files. You can use standard Unix tools such as `less production.log` to inspect them.

This folder is also available without entering the container as `/var/discourse/shared/standalone/log/rails`.

## The NGINX logs

Occasionally NGINX logs may contain some extra tips, they are located at:

```plaintext
cd /var/discourse
./launcher enter app
cd /var/log/nginx

```

The files `access.log` and `error.log` will be there as well as a bunch of rotated compressed files. Running `less access.log.2.gz` will automatically decompress and display the logfile for you.

This directory is also available on the host at `/var/discourse/shared/standalone/log/var-log/nginx` .

## Redis logs

While it is very uncommon to need to see Redis logs, if you do need them, they go into `/var/log/redis` inside the container and `/var/discourse/shared/standalone/log/var-log/redis` on the host. The most recent log entries will be in the `current` file in that directory.

### PostgreSQL logs

If you need to consult the database server logs, they’re in `/var/log/postgres` inside the container and `/var/discourse/shared/standalone/log/var-log/postgres` on the host; the most recent entries are in the `current` file in that directory.

> Last edited by @JammyDodger 2024-05-25T11:27:33Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![tarunkumar](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@tarunkumar](https://meta.discourse.org/u/tarunkumar)
#### Post date: [April 30, 2019, 6:43am UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/3 "2019-04-30T06:43:27Z")

</div>

> [@sam](#):
>
> cd /var/discourse ./launcher enter app cd /shared/log/rails

Is there any option/console in admin ui to run these command and get logs in web? I do not see any option.

---

<div class="post-metadata">

### Author: ![Ghan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ghan/32/177964_2.png) [@Ghan](https://meta.discourse.org/u/Ghan)
#### Post date: [April 27, 2020, 4:38pm UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/5 "2020-04-27T16:38:29Z")

</div>

I have also found this log to be useful:

`./launcher logs app`

This shows any errors during the build process if you don’t know which app to look at.

---

<div class="post-metadata">

### Author: ![frank.manuel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank.manuel/32/203348_2.png) [@frank.manuel](https://meta.discourse.org/u/frank.manuel)
#### Post date: [May 15, 2021, 5:47pm UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/6 "2021-05-15T17:47:00Z")

</div>

I don’t have a postgres folder in `/var/log/postgres` or `/var/discourse/shared/standalone/log/var-log/postgres`. Is there some configuration I need to make to generate DB logs?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [May 15, 2021, 5:55pm UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/7 "2021-05-15T17:55:05Z")

</div>

If You’re using a 2 container install or external postgres, then the logs will not be there.

For 2 container install, the logs should be in the  
`/var/discourse/shared/data/log/var-log/postgres`

For external postgres, your logs should be with the managed db provider.

---

<div class="post-metadata">

### Author: ![FerrariFlunker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ferrariflunker/32/258011_2.png) [@FerrariFlunker](https://meta.discourse.org/u/FerrariFlunker)
#### Post date: [October 5, 2022, 4:00am UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/8 "2022-10-05T04:00:47Z")

</div>

When a plugin causes a failure during a rebuild, where do the logs live that show the specific error within the plugin?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 5, 2022, 1:44pm UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/9 "2022-10-05T13:44:54Z")

</div>

They live in the terminal window where you ran the rebuild. If you don’t have enough scrollback in your terminal then you’ll have to pay attention during the rebuild (or google to figure out how to increase the rollback, or to pipe the output somewhere you can find it later).l

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [August 20, 2024, 8:14am UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/11 "2024-08-20T08:14:29Z")

</div>

> [@Discourse](#):
>
> The Discourse admin panel contains several forms of logging:
> 
> - Emails that are sent, skipped, bounced, received and rejected are logged at https://=DOMAIN=/admin/email/sent and the neighboring tabs.
> - Staff actions are logged at https://=DOMAIN=/admin/logs/staff\_action\_logs
> - Email addresses and IP addresses that have been banned from registration will be listed at https://=DOMAIN=/admin/logs/screened\_emails and https://=DOMAIN=/admin/logs/screened\_ip\_addresses
> - Links posted by accounts that have been banned as spammers are listed at https://=DOMAIN=/admin/logs/screened\_urls
> - Search analytics logs are shown at https://=DOMAIN=/admin/logs/search\_logs

The placeholder doesn’t seem to work in the list

---

<div class="post-metadata">

### Author: ![bcye](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bcye/32/533240_2.png) [@bcye](https://meta.discourse.org/u/bcye)
#### Post date: [December 10, 2025, 8:12pm UTC](https://meta.discourse.org/t/where-does-discourse-store-and-show-logs/58022/12 "2025-12-10T20:12:59Z")

</div>

I’m trying to figure out which of these logs contain personal data and how long they are retained. It seems:

- Email logs are retained 90 days by default
- Rails logs contain IPs and are rotated after 7 days (from [\* logrotate.d](https://meta.discourse.org/t/default-ip-log-retention-time/42135/) )
- For NGINX the same applies
- Staff/Screening may contain personal data and are retained forever

Am I missing anything here?

Can the error logs ([discourse.example.com/logs](http://discourse.example.com/logs)) contain personal data too, if yes are they rotated?  
Can container logs contain personal information? (i.e. `./launcher logs app` etc.) I guess these need to manually be configured via docker to rotate.
