[android] Add runtime logging support for CoreCLR on Android

Open
#112,865 9 comments 0 reactions 1 assignee View on GitHub

@lateralusX is already working on this.

Since Feb 27, 2025.

Assessment

This issue has not been assessed yet.

Description

area-Diagnostics-coreclr

Description

This issue is made for tracking necessary work for enabling runtime logging for CoreCLR on Android.

Logging

Currently, most of the messages logged by the runtime end up in /dev/null (either because they
are disabled in release build or because they log to stdio which doesn't work on Android).

Logcat is the only way to get information from remote devices, especially via Google Play Console.

We should log to logcat:

  • C++ exception messages
  • abort() messages / fatal errors
  • warnings
  • errors

A subsystem should be added which will provide a single function that will do actual output, implementation of which
will be specific to the platform. API should allow specification of severity, the actual message, and possibly a flag
to indicate whether the process should be aborted (the decision might also be based on the severity). Severity should
be shared between all targets, which then can (if needed) translate it to the target platform's value(s), if any.

Tasks

References on runtime logging

https://github.com/dotnet/runtime/blob/9ff850ea5d29f487961d1c773bd495630aa8d2ea/docs/design/coreclr/botr/logging.md

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.