File based provider?
See original GitHub issueHiya,
This seems exactly what a was looking for. Only I have a File sink setup instead of sql. Would it be feasible to implement a file-based provider for serilog-ui?
An excerpt of my log file;
[10:20:51 INF] Sulis python based parser: null {"SourceContext":"Tdc.GenesisMachine.RemoteData.Shared.Windows.ProcessRunner"}
[10:20:51 INF] Process Sulis python based parser exited with exit code 0 at 19-2-2021 10:20:51 {"SourceContext":"Tdc.GenesisMachine.RemoteData.Shared.Windows.ProcessRunner"}
[10:20:51 INF] Done running {"Name":"Sulis python based parser","WaitForExit":true,"DurationMilliseconds":882.0070000000001,"TimeOutMilliseconds":0,"ExitedWhenWaitingForTimeout":false,"exitLogInfo":{"ExitCode":0,"ExitTime":"2021-02-19T10:20:51.9647150+01:00"}} {"SourceContext":"Tdc.GenesisMachine.RemoteData.Shared.Windows.ProcessRunner"}
[10:30:31 INF] Skipping download of remote file /StaticFiles/TemboAnalyticsLogs_20201023.zip, local file ...\Tembo Paper - KAMPEN (NL) - Sulis_P02378_Line1\TDCNL_0045~TemboAnalyticsLogs_20201023.zip was up to date, Local file size: 7116022 vs remote file size: 7116022 {"SourceContext":"Tdc.GenesisMachine.RemoteData.Shared.HangFireJobs.RemoteDataFilePuller"}
[10:30:31 INF] Skipping download of remote file /StaticFiles/TemboAnalyticsLogs_20201026.zip, local file ...\Tembo Paper - KAMPEN (NL) - Sulis_P02378_Line1\TDCNL_0045~TemboAnalyticsLogs_20201026.zip was up to date, Local file size: 7393688 vs remote file size: 7393688 {"SourceContext":"Tdc.GenesisMachine.RemoteData.Shared.HangFireJobs.RemoteDataFilePuller"}
[10:30:31 INF] Skipping download of remote file /StaticFiles/TemboAnalyticsLogs_20201027.zip, local file ...\Tembo Paper - KAMPEN (NL) - Sulis_P02378_Line1\TDCNL_0045~TemboAnalyticsLogs_20201027.zip was up to date, Local file size: 7628661 vs remote file size: 7628661 {"SourceContext":"Tdc.GenesisMachine.RemoteData.Shared.HangFireJobs.RemoteDataFilePuller"}
The logging config is as follows:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"System.Net.Http.HttpClient": "Information",
"Hangfire": "Information"
}
},
"Serilog": {
"Using": [ "Serilog.Sinks.Console" ],
"WriteTo": [
{
"Name": "Console",
"outPutTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {Properties:j}{NewLine}{Exception}"
},
{
"Name": "File",
"Args": {
"path": "%CUROUTDIR%\\..\\Logs\\RemoteData.WorkerService.txt",
"rollingInterval": "Day",
"rollOnFileSizeLimit": true,
"retainedFileCountLimit": 31,
"fileSizeLimitBytes": 5242880,
"outPutTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {Properties:j}{NewLine}{Exception}"
}
}
]
}
I could of course change the template to something that would be easier to parse. I’d just like your opinion if something like this would be feasible and perhaps I take a crack at it.
Adding another provider for sql server for a fancy log viewer seems a bit too much consider the scope of my project. Although perhaps that’s a common solution.
In anyway I want to keep file based logging.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
File Providers in ASP.NET Core - Microsoft Learn
ASP.NET Core abstracts file system access through the use of File Providers. File Providers are used throughout the ASP.NET Core framework.
Read more >Traefik File Documentation
The file provider in Traefik Proxy lets you define the dynamic configuration in a YAML or TOML file. Read the technical documentation.
Read more >File Provider | Apple Developer Documentation
The file provider focuses on syncing data between the local copy and the remote storage—uploading any local changes and downloading any remote changes....
Read more >Authorized IRS e-file Provider Locator Service For Tax ...
Identify and locate different types of Authorized IRS e-file Providers through interactive searches - e.g., Electronic Return Originators (EROs) ...
Read more >Oracle Unified Directory - File Based Key Manager Provider
The File Based Key Manager Provider can be used to obtain the server certificate from a key store file on the local file...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@sommmen you need to implement
IDataProvider
interface for the file sink. Please check out other providers to see how they are implemented.There are several issues that need to be considered:
dev
branch