nblumhardt on dev
Remove redundant `.` from examp… (compare)
dependabot[bot] on nuget
nblumhardt on dev
Bump Newtonsoft.Json in /test/S… Merge pull request #50 from ser… (compare)
dependabot[bot] on nuget
dependabot[bot] on nuget
Bump Newtonsoft.Json in /test/S… (compare)
dependabot[bot] on nuget
Bump Newtonsoft.Json in /test/S… (compare)
dependabot[bot] on nuget
Bump Newtonsoft.Json in /test/S… (compare)
dependabot[bot] on nuget
Bump Newtonsoft.Json in /test/S… (compare)
dependabot[bot] on nuget
Bump Newtonsoft.Json in /src/Se… (compare)
serilog-build on v3.0.0
serilog-build on v79
nblumhardt on dev
Dev version bump [skip ci] (compare)
nblumhardt on main
Dev version bump [skip ci] Don't specify --version-suffix … Merge pull request #56 from nbl… and 2 more (compare)
nblumhardt on dev
Revert dev version bump [skip c… (compare)
nblumhardt on dev
Don't specify --version-suffix … Merge pull request #56 from nbl… (compare)
nblumhardt on dev
Dev version bump [skip ci] (compare)
nblumhardt on main
Align `<VersionPrefix>` & `<Tar… Add missing `Microsoft.Extensio… Change `<VersionPrefix>` from 3… and 12 more (compare)
nblumhardt on dev
Update README to ASP.NET Core 6… Update README.md Merge pull request #54 from mma… (compare)
nblumhardt on dev
Remove out of support target fr… Merge pull request #311 from 0x… (compare)
skomis-mm on dev
Fix some warnings and suggestio… Merge pull request #313 from 0x… (compare)
public static Logger GetLogger(SeriLogSettings options)
{
if (_logger == null)
{
var _loggerConfig = new LoggerConfiguration(); //.ReadFrom.AppSettings();
_loggerConfig.WriteTo.Async(a => a.Graylog(GetSink(options)));
_logger = _loggerConfig.CreateLogger();
}
return _logger;
}
public static Logger InitiateLog
{
get { return _logger; }
}
public static GraylogSinkOptions GetSink(SeriLogSettings options)
{
return new GraylogSinkOptions
{
HostnameOrAddress = options.HostNameOrAddress,
Port = options.Port,
TransportType = TransportType.Http,
HttpClientFactory = () =>
{
var http = new HttpClient(new HttpClientHandler());
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", options.BasicAuth);
return http;
}
};
}
private readonly SeriLogSettings _options;
}
Destructure.ToMaximumStringLength
but obviously it does not apply to strings themselves if for example I call logger.LogInformation("Hello {Target}", "VeryBigStingIWantToTruncateElseKaboomInElasticSearch")
;
hello, i am experiencing an issue with serilog, iis, sql, and .net framework. i have used serilog with .net 5 microservice and works perfectly. the sql server permissions appear to be fine. i can run locally .net framework solution and target the sql server directly with the connection string.
I have added <section name="MSSqlServerSettingsSection" type="Serilog.Configuration.MSSqlServerConfigurationSection, Serilog.Sinks.MSSqlServer"/> to the web.config.
and lower down in web.config:
<MSSqlServerSettingsSection>
<!-- SinkOptions parameters -->
<BatchPostingLimit Value="150"/>
<BatchPeriod Value="00:00:15"/>
<!-- ColumnOptions parameters -->
<AddStandardColumns>
<add Name="LogEvent"/>
</AddStandardColumns>
<RemoveStandardColumns>
<remove Name="MessageTemplate"/>
</RemoveStandardColumns>
<TimeStamp ConvertToUtc="true"/>
</MSSqlServerSettingsSection>
any ideas what i could try?
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.Async(a => a.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"), blockWhenFull: true)
.WriteTo.Async(b => b.File("log.txt",
rollingInterval:RollingInterval.Day,
rollOnFileSizeLimit:true,
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}"), blockWhenFull: true)
.CreateLogger();
This is my setup, but as soon as i start my backgroundworker it doesn't log from it to console. only to file