-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No logs are created - what am I missing? #12
Comments
Is this your full configuration? No If so, please refer to the docs on configuration:
Otherwise, please verify that the process has the sufficient file system permissions on the On a side note, the logger creates the log directory if it doesn't exist, so you can safely remove the following lines: if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
} |
If I don't create the folder, I get an exception on setting the value to Root: System.IO.DirectoryNotFoundException |
What's the minimum set of properties I need to set on the the single File object I create in the Files array? Just creating an array with a single instantiation of the LogFileOptions class, does not work either. |
Ok, let's first make clear which version of the lib you are using. My answer applies to v3.0 or later. In older versions the log directory wasn't created automatically unless you set |
Sorry for my oversight. Meanwhile I realized that my answer wasn't completely right, either. .AddFile(c =>
{
c.RootPath = Path.GetTempPath();
c.BasePath = "Paros.Logs";
c.MaxFileSize = 10_000_000;
c.FileAccessMode = Karambolo.Extensions.Logging.File.LogFileAccessMode.KeepOpenAndAutoFlush;
c.Files = new[]
{
new Karambolo.Extensions.Logging.File.LogFileOptions { Path = "default.log" }
};
});
As you can see above, you need to specify at least the |
Thanks. That solved my isseus. |
I have the following code - nothing in appsettings or anywhere...
And no logs are being created.
What else am I missing?
The text was updated successfully, but these errors were encountered: