docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Default configuration

    You can customize and configure the Logging package. For example, you can directly call the logger with something like:

    Log.Info("Hello Info");
    

    Under the hood, Unity configures the following things by default:

    • It captures the logs asynchronously except for log entries with Fatal level.
    • It sets the minimum captured level to Debug. Including debug level log entries, everything above (info, warning, error, fatal) is captured as well.
    • The output template is as follows:
      [{Timestamp}] {Level} | {Message}{NewLine}{Stacktrace}
      
    • It captures the generated log files in the logs/ folder of the project under the filename Output.log.json and Output.log
    • The logs also appear in the Unity Editor console when available (for versions of Unity after 2022.2.0a15)

    To create a more complex configuration, you can create a LoggerConfig object and pipeline different options such as :

    Log.Logger = new Logger(new LoggerConfig()
    .MinimumLevel.Debug()
    .OutputTemplate("{Timestamp} - {Level} - {Message}")
    .WriteTo.File("..absolutPath.../LogName.log", minLevel: LogLevel.Verbose)
    .WriteTo.StdOut(outputTemplate: "{Level} || {Timestamp} || {Message}"));
    

    The LoggerConfig options are detailed in the Custom configuration documentation.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)