Skip to content

LoggingErrors

cketti edited this page May 10, 2022 · 34 revisions

Introduction

K-9 Mail has controllable debug logging. Users can activate logging to help diagnosing problems and errors.

Details

Step 1: Activate Debug Logging in K-9 Mail

Go to Settings → General settings → Debugging and check Enable debug logging.

If K-9 is crashing or you otherwise can't get to the settings screen, skip this step.

Step 2: Trigger error

Do whatever causes the problem/error.

Step 3: Get Debug Log

Using the app

If the app isn't crashing during startup, you can export the debug log from inside the app. Go to Settings → General settings → Debugging, then select Export logs from the menu. You'll be prompted for a location to save the log to.

NOTE: This option is only available on K-9 Mail 6.000 and newer.

Using a PC

Attach the device to your PC and use the tool adb from the Android SDK:

  1. Follow these instructions to install adb and to connect your device.

  2. Find the process ID of K-9 Mail:

    In Linux / Mac

     adb shell pgrep k9
    

    In Windows

     adb shell ps -A | findstr k9
    

    The output will be similar to:

    u0_a153       5191   587 4468612 112380 SyS_epoll_wait      0 S com.fsck.k9
    

    In this example the PID is 5191

  3. To capture the debug log in a file named k9-log.txt, enter the command:

    adb logcat -d --pid=<PID> > k9-log.txt
    

NOTE: replace the whole of <PID> with the process ID or it won't be recognized. ADB error might read "> was unexpected at this time."

Step 4: Create an Issue in our Bug Tracker

To be able to fix your problem we need to know about it. Please create a new issue in our bug tracker. Attach a copy of the debug log you just created.

It's ok to remove your password from the debug log. Other than that, please give us as much of the log as you possibly can.

Important: Include the exact version number of your installed K-9 Mail in the bug report. Read GetVersionNumber if you need help on finding out which version of K-9 you're running.