Skip to content

Enabling Debug Logging

Daniel Cherubini edited this page Feb 6, 2026 · 1 revision

Enabling Debug Logging

Debug logging provides detailed information about what the integration is doing, which is essential for troubleshooting connection issues, errors, or unexpected behavior.

When You Need Debug Logs

You should enable debug logging when:

  • The integration fails to connect to your printer
  • Entities are not appearing or updating correctly
  • You're experiencing errors or unexpected behavior
  • You've been asked to provide logs in an issue or discussion

How to Enable Debug Logging

Method 1: Using configuration.yaml (Recommended)

  1. Open your Home Assistant configuration file

    • Navigate to your Home Assistant config directory
    • Open configuration.yaml in a text editor
  2. Add or modify the logger section

    If you already have a logger: section, add the elegoo_printer line under logs::

    logger:
      default: info
      logs:
        custom_components.elegoo_printer: debug

    If you don't have a logger: section, add this at the end of your configuration.yaml:

    logger:
      default: info
      logs:
        custom_components.elegoo_printer: debug
  3. Save the file and restart Home Assistant

    • Go to SettingsSystemRestart
    • Or use the "Restart" button in your preferred method
  4. Reproduce the issue

    • Try to connect to your printer, trigger the error, or perform the action that's causing problems
  5. Collect the logs

    • Logs are located at config/home-assistant.log
    • You can also view them via SettingsSystemLogs

Method 2: Using the UI (Temporary)

This method enables debug logging temporarily without restarting Home Assistant, but it will reset after a restart.

  1. Go to SettingsSystemLogs
  2. Click the Settings icon (gear) in the top right
  3. Find custom_components.elegoo_printer in the list
  4. Set the log level to Debug
  5. Reproduce the issue
  6. Return to the Logs page to view the output

What to Look For in Debug Logs

When debug logging is enabled, look for lines containing:

  • custom_components.elegoo_printer - All integration-related messages
  • ERROR or WARNING - Specific error messages
  • Connection attempts and responses from the printer
  • SDCP protocol messages and commands

Sharing Debug Logs

When sharing debug logs in an issue or discussion:

  1. Copy relevant sections - Include the full error stack trace and surrounding context (about 20-50 lines before and after the error)

  2. Use code blocks - Format logs using markdown code blocks for readability:

    ```
    [your log content here]
    ```
  3. Remove sensitive information - Check for and remove:

    • IP addresses (if you prefer to keep them private)
    • API keys or tokens
    • Personal information
  4. Include context - Mention:

    • Your printer model (e.g., Neptune 4 Pro, Saturn 4 Ultra, CC2)
    • Firmware version
    • Integration version
    • What you were trying to do when the error occurred

Example Debug Output

Here's what debug logging looks like:

2026-02-07 10:15:23.456 DEBUG (MainThread) [custom_components.elegoo_printer] Attempting to connect to printer at 192.168.1.100:3030
2026-02-07 10:15:23.567 DEBUG (MainThread) [custom_components.elegoo_printer.websocket.client] Sending command: CMD_GET_PRINTER_INFO
2026-02-07 10:15:23.789 DEBUG (MainThread) [custom_components.elegoo_printer.websocket.client] Received response: {"Id":256,"Data":{"Name":"My Printer"}}

Disabling Debug Logging

Once you've collected the logs you need:

If you used configuration.yaml:

  1. Remove or comment out the elegoo_printer line:
    logger:
      default: info
      logs:
        # custom_components.elegoo_printer: debug
  2. Restart Home Assistant

If you used the UI method:

  • Debug logging will automatically reset to default after a Home Assistant restart
  • Or go back to SettingsSystemLogsSettings and change it back to Info or Warning

Troubleshooting Tips

Logs are too large

If your home-assistant.log file is too large:

  • Use tail -n 500 config/home-assistant.log to get the last 500 lines
  • Or search for specific errors: grep -A 20 "elegoo_printer.*ERROR" config/home-assistant.log

Can't find the logs

  • Default location: /config/home-assistant.log
  • In Docker/Container setups, this is inside the container
  • Use the Home Assistant UI: SettingsSystemLogs

Debug logging not working

  • Verify the indentation in configuration.yaml (YAML is sensitive to spaces)
  • Make sure you restarted Home Assistant after editing the configuration
  • Check for YAML syntax errors: Developer ToolsYAMLCheck Configuration

Need More Help?

If you're still having trouble after enabling debug logging:

  1. Open a new Discussion for questions
  2. Open an Issue for bugs (include debug logs!)
  3. Make sure to include all the information mentioned in the "Sharing Debug Logs" section above

Clone this wiki locally