Bug 58857 - Allow developers to change the MONO_LOG_LEVEL value through project options.
Summary: Allow developers to change the MONO_LOG_LEVEL value through project options.
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: 4.6.0 (15.3)
Hardware: PC Windows
: Normal enhancement
Target Milestone: 15.6
Assignee: Bugzilla
Depends on:
Reported: 2017-08-17 17:50 UTC by Jon Douglas [MSFT]
Modified: 2017-10-06 01:21 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jon Douglas [MSFT] 2017-08-17 17:50:39 UTC

In iOS and Android projects, there is a default Mono log level that is set implicitly. This level I believe is currently "info" which can be quite chatty and scare developers into thinking something has gone wrong when running their application and viewing the output. This is controlled by Mono logging trace level:


This feature request hopes to outline the need for a GUI property that can be set in both a Xamarin.Android and Xamarin.iOS project in which one can change the respective Mono Log Level via a dropdown UI element in the project options with the values of:


Here is the command line help snippet for MONO_LOG_LEVEL - http://docs.go-mono.com/?link=man%3amono(1)

      The MONO_LOG_LEVEL environment variable if set, the  logging  level  is
      changed  to  the  set  value.  Possible values are "error", "critical",
      "warning", "message", "info", "debug". The default  value  is  "error".
      Messages  with  a  logging level greater then or equal to the log level
      will be printed to stdout/stderr.

      Use "info" to track the dynamic loading of assemblies.

The reasoning behind this item is that this will help developers set these values(instead of having them do it via environment files and build actions), and also allow the developer to experiment with the value for their project's needs. 

It would also be helpful if each value has a description of what type of logging you will respectfully receive.


How to set - https://developer.xamarin.com/guides/android/advanced_topics/environment/


If `MONO_LOG_LEVEL=info` is set, the `G_LOG_LEVEL_INFO` messages from the mono runtime get mapped to Android's *debug* level and you will see it as `D/Mono` in logcat.



How to set - https://developer.xamarin.com/guides/ios/advanced_topics/environment/#Permanent_environment_variables

*Related Enhancements/Bugs:




Comment 2 Pierce Boggan [MSFT] 2017-09-13 20:58:13 UTC
Tentatively moving this feature work to 15.6. We will create an associated work item for tracking in VSTS when we begin work on that milestone.
Comment 3 Pierce Boggan [MSFT] 2017-10-06 01:21:05 UTC
Thanks for taking the time to report this issue. :)

Given this is a feature request or enhancement, I am closing this issue and adding a work item to our backlog.