Skip to content

Uno.Extensions.Logging.Serilog - fileLoggingEnabled #3123

Description

@lhLife

Current behavior

        private static string? GetLogFilePath(HostBuilderContext hostBuilderContext)
        {
            var logDirectory = hostBuilderContext.HostingEnvironment.GetAppDataPath();
            if (string.IsNullOrWhiteSpace(logDirectory))
            {
                return null;
            }
    
            var assemblyName = PlatformHelper.GetAppAssembly()?.FullName ?? "unologging";
            return Path.Combine(logDirectory, $"{assemblyName}.log");
        }

Expected behavior

      private static string? GetLogFilePath(HostBuilderContext hostBuilderContext)
        {
            var logDirectory = hostBuilderContext.HostingEnvironment.GetAppDataPath();
            if (string.IsNullOrWhiteSpace(logDirectory))
            {
                return null;
            }
    
            var assemblyName = PlatformHelper.GetAppAssembly()?.GetName().Name ?? "unologging";
            return Path.Combine(logDirectory, $"{assemblyName}.log");
        }

How to reproduce it (as minimally and precisely as possible)

Environment

Nuget Package (s):

Package Version(s):

Affected platform(s):

  • iOS
  • macOS (AppKit)
  • Mac Catalyst
  • Android
  • WebAssembly
  • Windows
  • Skia (WPF)
  • Skia (GTK on Linux/macOS/Windows)
  • Skia (Linux Framebuffer)
  • Build tasks

Visual Studio:

  • 2019 (version: )
  • 2022 (version: )
  • Visual Studio Code (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't workingtriage/untriagedIndicates an issue requires triaging or verification.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions