Troubleshooting doc update

pull/678/head
binwiederhier 2023-03-20 21:50:54 -04:00
parent bcb24aecd3
commit c6a96d19e2
1 changed files with 46 additions and 28 deletions

View File

@ -19,9 +19,8 @@ boils down to setting `log-level: debug` or `log-level: trace` in the `server.ym
``` ```
If you're using environment variables, set `NTFY_LOG_LEVEL=debug` (or `trace`) instead. You can also pass `--debug` or `--trace` If you're using environment variables, set `NTFY_LOG_LEVEL=debug` (or `trace`) instead. You can also pass `--debug` or `--trace`
to the `ntfy serve` command, e.g. `ntfy serve --trace`. If you're using systemd (i.e. `systemctl`) to run ntfy, you can look at the logs using `journalctl -u ntfy -f`. to the `ntfy serve` command, e.g. `ntfy serve --trace`. If you're using systemd (i.e. `systemctl`) to run ntfy, you can look at
the logs using `journalctl -u ntfy -f`. The logs will look something like this:
Assuming trace is enabled, the logs will look something like this:
=== "Example logs (debug)" === "Example logs (debug)"
``` ```
@ -77,7 +76,6 @@ entries, which you can then copy or upload.
When you copy or upload the logs, you can censor them to make it easier to share them with others. ntfy will replace all When you copy or upload the logs, you can censor them to make it easier to share them with others. ntfy will replace all
topics and hostnames with fruits. Here's an example: topics and hostnames with fruits. Here's an example:
=== "Android log (censored)"
``` ```
This is a log of the ntfy Android app. The log shows up to 1,000 entries. This is a log of the ntfy Android app. The log shows up to 1,000 entries.
Server URLs (aside from ntfy.sh) and topics have been replaced with fruits 🍌🥝🍋🥥🥑🍊🍎🍑. Server URLs (aside from ntfy.sh) and topics have been replaced with fruits 🍌🥝🍋🥥🥑🍊🍎🍑.
@ -103,6 +101,23 @@ topics and hostnames with fruits. Here's an example:
... ...
``` ```
To get live logs, or to get more advanced access to an Android phone, you can use [adb](https://developer.android.com/studio/command-line/adb).
After you install and [enable adb debugging](https://developer.android.com/studio/command-line/adb#Enabling), you can
get detailed logs like so:
```
# Connect to phone (enable Wireless debugging first)
adb connect 192.168.1.137:39539
# Print all logs; you may have to pass the -s option
adb logcat
adb -s 192.168.1.137:39539 logcat
# Only list ntfy logs
adb logcat --pid=$(adb shell pidof -s io.heckel.ntfy)
adb -s 192.168.1.137:39539 logcat --pid=$(adb -s 192.168.1.137:39539 shell pidof -s io.heckel.ntfy)
```
## Web app ## Web app
The web app logs everything to the **developer console**, which you can open by **pressing the F12 key** on your The web app logs everything to the **developer console**, which you can open by **pressing the F12 key** on your
keyboard. keyboard.
@ -111,3 +126,6 @@ keyboard.
![Web app logs](static/img/web-logs.png) ![Web app logs](static/img/web-logs.png)
<figcaption>Web app logs in the developer console</figcaption> <figcaption>Web app logs in the developer console</figcaption>
</figure> </figure>
## iOS app
Sorry, there is no way to debug or get the logs from the iOS app (yet), outside of running the app in Xcode.