From 8eaa94e179939ce5eb4793602e101c664f1533fc Mon Sep 17 00:00:00 2001 From: AnomicDev Date: Sun, 14 Apr 2024 00:55:24 +0000 Subject: [PATCH] Update troubleshooting.md --- docs/maintenance/troubleshooting.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/maintenance/troubleshooting.md b/docs/maintenance/troubleshooting.md index 6c860586..cb23093d 100644 --- a/docs/maintenance/troubleshooting.md +++ b/docs/maintenance/troubleshooting.md @@ -2,9 +2,13 @@ ## Logging -In its default configuration, your auth project logs INFO and higher messages to myauth/log/allianceauth.log. If you're encountering issues, it's a good idea to view DEBUG messages as these greatly assist the troubleshooting process. These are printed to the console with manually starting the webserver via `python manage.py runserver`. +In its default configuration, your auth project logs INFO and higher messages to myauth/log/allianceauth.log. +If you're encountering issues, it's a good idea to view DEBUG messages as these greatly assist the troubleshooting process. +These are printed to the console with manually starting the webserver via `python manage.py runserver`. -To record DEBUG messages in the log file, alter a setting in your auth project's settings file: `LOGGING['handlers']['log_file']['level'] = 'DEBUG'`. After restarting gunicorn and celery, your log file will record all logging messages. +To record DEBUG messages in the log file, +alter a setting in your auth project's settings file: `LOGGING['handlers']['log_file']['level'] = 'DEBUG'`. +After restarting gunicorn and celery, your log file will record all logging messages. ## Common Problems @@ -17,7 +21,8 @@ The logs are located within the `myauth/log/` directory of your Alliance Auth pr ### Access the Logs: Use a text editor or terminal commands (like `tail -f `) to open the relevant log files. -_(The tail -f command displays the last few lines of a file and then continues to monitor the file, printing any new lines that are added in real-time. Useful to watch while actively testing a troublesome feature for debugging.) +_(The tail -f command displays the last few lines of a file and then continues to monitor the file, +printing any new lines that are added in real-time. Useful to watch while actively testing a troublesome feature for debugging.)_ Consider the following: `allianceauth.log` is the primary log for general troubleshooting. `worker.log` is important for issues related to background tasks.(Such as services(Discord)). @@ -31,9 +36,12 @@ Examine timestamps to correlate errors with user actions or events. Read the error messages carefully for clues about the problem's nature. Troubleshooting Tips -**Filter Logs:** Use tools like `grep` to filter logs based on keywords or timeframes, making it easier to focus on relevant information. -**_Example_**: `tail -f allianceauth.log | grep -i 'discord'`. This will isolate lines containing discord. Making it easier to see amoung the other logs. -**Debug Mode:** For in-depth troubleshooting, temporarily enable DEBUG logging in your Alliance Auth settings to get more detailed messages. Remember to revert to INFO level after debugging. +**Filter Logs:** Use tools like `grep` to filter logs based on keywords or timeframes, +making it easier to focus on relevant information. +**_Example_**: `tail -f allianceauth.log | grep -i 'discord'`. This will isolate lines containing discord. +Making it easier to see amoung the other logs. +**Debug Mode:** For in-depth troubleshooting, temporarily enable DEBUG logging in your Alliance Auth +settings to get more detailed messages. Remember to revert to INFO level after debugging. **Important Note: Before sharing logs publicly, sanitize any sensitive information such as usernames, passwords, or API keys.**