Comments (29)
This problem is located in the Serilog.UI.MsSqlServerProvider 2.2.2. Downgraded to 2.2.1 and that fixes the issue.
from serilog-ui.
Hey @miglrodri 😊
You're on the right path with your guess, if you check the related PR the fix will be on the culture of the datetime parser.
The version is doing it with InvariantCulture while 2.2.1 wa using default CurrentCulture. In the PR I reverted this behavior and added a new delegate to let user customize the parse, if the default ones don't work as expected.
As soon as I have time, I'll write a couple of tests and release an alpha vrs to let you test it, with some additional info.
from serilog-ui.
Hello @miglrodri @GuidoNeele @bc3 [and everyone else in the thread]
you can find release MSSQL provider v2.2.3-beta.1 ready for testing 😄
I moved back the default datetime parsing to use CultureInfo.CurrentCulture and DateTimeStyle.Local, as it seemed to be the default use-case for the package.
If the parsing doesn't work or doesn't return results as you would expect, you have a new parameter to the package registration.
You can declare a custom delegate to parse datetime and the package will use it to parse MSSQL dates; please notice, the delegate must return a Datetime with DateKind.UTC or it will throw an exception.
As soon as we receive a positive feedback from your tests, I'll release a stable version :)
(wiki page to recap those info will come later, btw)
Thanks a lot for the patience!
from serilog-ui.
Hi also datetime
for me. When I get the chance I'll push my project to a repo
from serilog-ui.
@followynne I guess the issue is related to Parse method in DapperDateTimeHandler
class, however, @bc3 provided payload
version 222
{
"logs": [
{
"propertyType": "xml",
"rowNo": 1,
"level": "Information",
"message": "Request finished HTTP/1.1 GET https://localhost:44206/img/medianot-logo.svg - - - 304 - image/svg+xml 21.0895ms",
"timestamp": "2024-04-01T07:42:28",
indicates that the API returns correct data. I got confused.
from serilog-ui.
You got it opposite I think, it's mssql provider to be updated to 2.2.3-beta.1 and serilog-ui kept at 2.5.1 😉
For the parameter, let me know if the wiki page can be useful and it's understandable :https://github.com/serilog-contrib/serilog-ui/wiki/Providers:-MSSQL! Thanks 🤗
from serilog-ui.
for me was just about the updating to the beta version.
my program.cs is pretty simple. its the new dotnet core web app template with:
builder.Services.AddSerilogUi(options => ... options.UseSqlServer(connectionString ...
and
app.UseSerilogUi();
👍
from serilog-ui.
Hello everyone,
stable version 2.2.3 has been published, you can find additional info in the wikis.
from serilog-ui.
Update:
- This appears to affect newer versions only - I've downgraded to older versions and it retrieves the datetime correctly
- It looks like it is getting the month and day transposed.
Example:
In the timestamp column: 2023-11-01 07:45:56.287
In the http response: 2023-01-11T07:45:56
This is all out of the box configuration for both Serilog and Serilog.UI.
I'll see if I can pinpoint the PR that introduced this, might shed some light
from serilog-ui.
@Tanjecterly could you please let me know which SQL Server sink and version you are using?
from serilog-ui.
Thank you. I am using Serilog.Sinks.MSSqlServer 6.3.0
from serilog-ui.
Unfortunately, I'm not able to reproduce this issue.
Could you provide a sample project repo or sample DB backup that demonstrates the issue?
from serilog-ui.
from serilog-ui.
What is the type of TimeStamp column in your database?
from serilog-ui.
datetime
, length: 8, numeric precision: 23, numeric scale: 3, in my case.
from serilog-ui.
having a similar issue using the most recent versions of serilog and serilog ui.
from serilog-ui.
i also have this issue
i was on Serilog.UI 2.5.1 tried a downgrade to 2.5.0 or 2.4.0, no change,
Serilog.UI.MsSqlServerProvider 2.2.2
Serilog.Sinks.MSSqlServer 6.5.0
timestamp column database = datetime
sql server = 2016
thx for looking into this fix or workaround
from serilog-ui.
Hello @miglrodri, @GuidoNeele, @bc3, @m-fenne, @Tanjecterly 😸
I'll look at the issue as soon as possible. If you have time, can you share an example of the API response you have?
If you open the serilog-ui page and go in the browser Development Tools, Network tab, you should find calls to an endpoint /logs - if you could upload a response body example it would be of great help to review how we format the dates in the frontend!
from serilog-ui.
below is a partial payload of that request @followynne , weird is that in the 221 version the date format is correct for my region: BE yyyy-MM-dd (we are january 4th) , and. in the 222 version it shows yyyy-dd-MM (and we are not yet april 1st), so i wonder if last month the issue was that for example 19/12 could not be transformed to 12/19, and hence we got the 1901-01-01 date ??
version 221
{
"logs": [
{
"propertyType": "xml",
"rowNo": 1,
"level": "Information",
"message": "Request finished HTTP/1.1 GET https://localhost:44206/serilog-ui/api/logs?&key=&page=1&count=10&level=&search=&startDate=&endDate= - - - 200 - application/json;charset=utf-8 192.1327ms",
"timestamp": "2024-01-04T07:39:36",
version 222
{
"logs": [
{
"propertyType": "xml",
"rowNo": 1,
"level": "Information",
"message": "Request finished HTTP/1.1 GET https://localhost:44206/img/medianot-logo.svg - - - 304 - image/svg+xml 21.0895ms",
"timestamp": "2024-04-01T07:42:28",
from serilog-ui.
Hello @miglrodri, @GuidoNeele, @bc3, @m-fenne, @Tanjecterly 😸
I'll look at the issue as soon as possible. If you have time, can you share an example of the API response you have?
If you open the serilog-ui page and go in the browser Development Tools, Network tab, you should find calls to an endpoint /logs - if you could upload a response body example it would be of great help to review how we format the dates in the frontend!
Thanks for looking into this! 🙇
{
"logs": [
{
"propertyType": "xml",
"rowNo": 1,
"level": "Fatal",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogCritical to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogCritical to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 2,
"level": "Error",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogError to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogError to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 3,
"level": "Warning",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogWarning to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogWarning to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 4,
"level": "Information",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogInformation to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogInformation to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 5,
"level": "Debug",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogDebug to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogDebug to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 6,
"level": "Fatal",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogCritical to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogCritical to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>273cb24b-25ae-489a-9654-8826261c031b</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQ76R3TT9:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQ76R3TT9</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 7,
"level": "Error",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogError to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogError to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>273cb24b-25ae-489a-9654-8826261c031b</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQ76R3TT9:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQ76R3TT9</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 8,
"level": "Warning",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogWarning to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogWarning to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>273cb24b-25ae-489a-9654-8826261c031b</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQ76R3TT9:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQ76R3TT9</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 9,
"level": "Information",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogInformation to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogInformation to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>273cb24b-25ae-489a-9654-8826261c031b</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQ76R3TT9:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQ76R3TT9</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 10,
"level": "Debug",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogDebug to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogDebug to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>273cb24b-25ae-489a-9654-8826261c031b</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQ76R3TT9:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQ76R3TT9</property></properties>"
}
],
"total": 24,
"count": 10,
"currentPage": 1
}
Edited:
Versions UI:
<PackageReference Include="Serilog.UI" Version="2.5.1" />
<PackageReference Include="Serilog.UI.MsSqlServerProvider" Version="2.2.2" />
Serilog:
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="6.5.0" />
Dotnet:
net6.0
My entity:
public class SeriLog
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[MaxLength]
public string Message { get; set; }
[MaxLength]
public string MessageTemplate { get; set; }
[MaxLength(128)]
public string Level { get; set; }
public DateTime TimeStamp { get; set; }
[MaxLength]
public string Exception { get; set; }
[MaxLength]
public string Properties { get; set; }
[MaxLength]
public string LogEvent { get; set; }
}
from serilog-ui.
@followynne , i got some new interesting data.. i will post the database timestamps and what i receive in serilog ui. it seems that can be some regional stuff? because the timestamp
/logs endpoint response:
[
{
"propertyType": "xml",
"rowNo": 1,
"level": "Debug",
"message": "u:\"9740291c-1501-4c0b-87b6-44b9db672353\" | c:\"EasyPayService\" | a:\"CreateLink | paymentToAdd\" | d:\"{ orderId = 56fec273-8f63-4e7b-3ba8-08dbfa4344ad, creatorId = 9740291c-1501-4c0b-87b6-44b9db672353, phone = 914960423, amount = 6.45, paymentToAdd = farmaci_api.Models.OrderEasyPayPaymentUrl }\"",
"timestamp": "2024-11-01T20:43:41",
"properties": "<properties><property key='UserId'>9740291c-1501-4c0b-87b6-44b9db672353</property><property key='Context'>EasyPayService</property><property key='Action'>CreateLink | paymentToAdd</property><property key='details'>{ orderId = 56fec273-8f63-4e7b-3ba8-08dbfa4344ad, creatorId = 9740291c-1501-4c0b-87b6-44b9db672353, phone = 914960423, amount = 6.45, paymentToAdd = farmaci_api.Models.OrderEasyPayPaymentUrl }</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>3cbfcc88-a1d8-46d9-b84b-5e6b317499d1</property><property key='ActionName'>farmaci_api.Controllers.PaymentsController.CreatePaymentLink (farmaci-api)</property><property key='RequestId'>0HN0ISKV55P3J:0000003F</property><property key='RequestPath'>/api/payments/createpaymentlink</property><property key='ConnectionId'>0HN0ISKV55P3J</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 2,
"level": "Debug",
"message": "u:\"9740291c-1501-4c0b-87b6-44b9db672353\" | c:\"EasyPayService\" | a:\"CreateLink | restResponse.IsSuccessful\" | d:\"{ orderId = 56fec273-8f63-4e7b-3ba8-08dbfa4344ad, creatorId = 9740291c-1501-4c0b-87b6-44b9db672353, phone = 914960423, amount = 6.45, restResponse = RestSharp.RestResponse }\"",
"timestamp": "2024-11-01T20:43:41",
"properties": "<properties><property key='UserId'>9740291c-1501-4c0b-87b6-44b9db672353</property><property key='Context'>EasyPayService</property><property key='Action'>CreateLink | restResponse.IsSuccessful</property><property key='details'>{ orderId = 56fec273-8f63-4e7b-3ba8-08dbfa4344ad, creatorId = 9740291c-1501-4c0b-87b6-44b9db672353, phone = 914960423, amount = 6.45, restResponse = RestSharp.RestResponse }</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>3cbfcc88-a1d8-46d9-b84b-5e6b317499d1</property><property key='ActionName'>farmaci_api.Controllers.PaymentsController.CreatePaymentLink (farmaci-api)</property><property key='RequestId'>0HN0ISKV55P3J:0000003F</property><property key='RequestPath'>/api/payments/createpaymentlink</property><property key='ConnectionId'>0HN0ISKV55P3J</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 3,
"level": "Debug",
"message": "u:\"9740291c-1501-4c0b-87b6-44b9db672353\" | c:\"EasyPayService\" | a:\"CreateLink | Prepare object to send\" | d:\"{ orderId = 56fec273-8f63-4e7b-3ba8-08dbfa4344ad, creatorId = 9740291c-1501-4c0b-87b6-44b9db672353, phone = 914960423, amount = 6.45, requestBody = farmaci_api.Dtos.EasyPayPaymentByLinkRequestDto }\"",
"timestamp": "2024-11-01T20:43:41",
"properties": "<properties><property key='UserId'>9740291c-1501-4c0b-87b6-44b9db672353</property><property key='Context'>EasyPayService</property><property key='Action'>CreateLink | Prepare object to send</property><property key='details'>{ orderId = 56fec273-8f63-4e7b-3ba8-08dbfa4344ad, creatorId = 9740291c-1501-4c0b-87b6-44b9db672353, phone = 914960423, amount = 6.45, requestBody = farmaci_api.Dtos.EasyPayPaymentByLinkRequestDto }</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>3cbfcc88-a1d8-46d9-b84b-5e6b317499d1</property><property key='ActionName'>farmaci_api.Controllers.PaymentsController.CreatePaymentLink (farmaci-api)</property><property key='RequestId'>0HN0ISKV55P3J:0000003F</property><property key='RequestPath'>/api/payments/createpaymentlink</property><property key='ConnectionId'>0HN0ISKV55P3J</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 4,
"level": "Debug",
"message": "u:\"9740291c-1501-4c0b-87b6-44b9db672353\" | c:\"EasyPayService\" | a:\"CreateLink()\" | d:\"{ orderId = 56fec273-8f63-4e7b-3ba8-08dbfa4344ad, creatorId = 9740291c-1501-4c0b-87b6-44b9db672353, phone = 914960423, amount = 6.45 }\"",
"timestamp": "2024-11-01T20:43:40",
"properties": "<properties><property key='UserId'>9740291c-1501-4c0b-87b6-44b9db672353</property><property key='Context'>EasyPayService</property><property key='Action'>CreateLink()</property><property key='details'>{ orderId = 56fec273-8f63-4e7b-3ba8-08dbfa4344ad, creatorId = 9740291c-1501-4c0b-87b6-44b9db672353, phone = 914960423, amount = 6.45 }</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>3cbfcc88-a1d8-46d9-b84b-5e6b317499d1</property><property key='ActionName'>farmaci_api.Controllers.PaymentsController.CreatePaymentLink (farmaci-api)</property><property key='RequestId'>0HN0ISKV55P3J:0000003F</property><property key='RequestPath'>/api/payments/createpaymentlink</property><property key='ConnectionId'>0HN0ISKV55P3J</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 5,
"level": "Debug",
"message": "u:\"9740291c-1501-4c0b-87b6-44b9db672353\" | c:\"PaymentsController\" | a:\"CreatePaymentLink\" | d:\"farmaci_api.Dtos.OrderCreatePaymentLinkDto\"",
"timestamp": "2024-11-01T20:43:40",
"properties": "<properties><property key='UserId'>9740291c-1501-4c0b-87b6-44b9db672353</property><property key='Context'>PaymentsController</property><property key='Action'>CreatePaymentLink</property><property key='details'>farmaci_api.Dtos.OrderCreatePaymentLinkDto</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>3cbfcc88-a1d8-46d9-b84b-5e6b317499d1</property><property key='ActionName'>farmaci_api.Controllers.PaymentsController.CreatePaymentLink (farmaci-api)</property><property key='RequestId'>0HN0ISKV55P3J:0000003F</property><property key='RequestPath'>/api/payments/createpaymentlink</property><property key='ConnectionId'>0HN0ISKV55P3J</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 6,
"level": "Warning",
"message": "Compiling a query which loads related collections for more than one collection navigation, either via 'Include' or through projection, but no 'QuerySplittingBehavior' has been configured. By default, Entity Framework will use 'QuerySplittingBehavior.SingleQuery', which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that's triggering this warning call 'ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning))'.",
"timestamp": "2024-11-01T20:38:44",
"properties": "<properties><property key='EventId'><structure type=''><property key='Id'>20504</property><property key='Name'>Microsoft.EntityFrameworkCore.Query.MultipleCollectionIncludeWarning</property></structure></property><property key='SourceContext'>Microsoft.EntityFrameworkCore.Query</property><property key='ActionId'>05753fca-e3af-4b6c-b3f4-009154ecf7ef</property><property key='ActionName'>farmaci_api.Controllers.OrdersController.GetOrderAccess (farmaci-api)</property><property key='RequestId'>0HN0ISKV55P3J:00000019</property><property key='RequestPath'>/api/orders/access/56fec273-8f63-4e7b-3ba8-08dbfa4344ad</property><property key='ConnectionId'>0HN0ISKV55P3J</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 7,
"level": "Fatal",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogCritical to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogCritical to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 8,
"level": "Error",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogError to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogError to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 9,
"level": "Warning",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogWarning to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogWarning to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
},
{
"propertyType": "xml",
"rowNo": 10,
"level": "Information",
"message": "u:null | c:\"PingController\" | a:\"TestLogger\" | d:\"LogInformation to serilog table\"",
"timestamp": "0001-01-01T00:00:00",
"properties": "<properties><property key='userId'></property><property key='context'>PingController</property><property key='action'>TestLogger</property><property key='details'>LogInformation to serilog table</property><property key='SourceContext'>farmaci_api.Services.LogService</property><property key='ActionId'>4341d5e6-0b9b-4ac0-b193-3da1b2dd68fd</property><property key='ActionName'>farmaci_api.Controllers.PingController.TestLogger (farmaci-api)</property><property key='RequestId'>0HMVVQTO0MI5K:00000001</property><property key='RequestPath'>/api/Ping/testlogger</property><property key='ConnectionId'>0HMVVQTO0MI5K</property></properties>"
}
]
i think that the date parser is doing something wrong because the timestamp is in utc (i think) yyyy-mm-dd, but when the serilog-ui requests the data from /logs endpoint, the data comes as yyyy-dd-mm, and because 11 January gets parsed as 1 of November, but 18 December does not get parsed correctly because 18 month does not exist and is parsed as initial datatime.
any idea why this is happening and where this regional stuff can be configured?
thanks 🙇
from serilog-ui.
@followynne , thanks a lot for taking the time to improve this.
please let me know when i can help.
🙇
from serilog-ui.
Hello @followynne ,
So i'm using the new beta release:
<PackageReference Include="Serilog.UI" Version="2.2.3-beta.1" />
<PackageReference Include="Serilog.UI.MsSqlServerProvider" Version="2.2.2" />
are these the correct versions?
but the results are the same ones, on the /logs request i got the timestamp 1 November 2024, instead of 14 January 2024.
can you please elaborate on how can i pass the new parameter to the package registration? 🤔
best regards
from serilog-ui.
@followynne , sorry, i was looking into the nuget package pages and i saw that i made a mistake.
upgrading the mssql provider to the beta version, now im getting the following errors, i will try to check why. im using dotnet core 6
error on build:
CSC : error CS1705: Assembly 'Serilog.Ui.Web' with identity 'Serilog.Ui.Web, Version=2.5.1.0, Culture=neut
ral, PublicKeyToken=null' uses 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Cu
lture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Micro
soft.Extensions.DependencyInjection.Abstractions' with identity 'Microsoft.Extensions.DependencyInjection.
Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' [C:\\api-logs\api-logs.csproj]
thanks
edit: trying to check with chatgpt if i get a solution will post here
from serilog-ui.
@followynne , sorry, i was looking into the nuget package pages and i saw that i made a mistake.
upgrading the mssql provider to the beta version, now im getting the following errors, i will try to check why. im using dotnet core 6
error on build:
CSC : error CS1705: Assembly 'Serilog.Ui.Web' with identity 'Serilog.Ui.Web, Version=2.5.1.0, Culture=neut ral, PublicKeyToken=null' uses 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=7.0.0.0, Cu lture=neutral, PublicKeyToken=adb9793829ddae60' which has a higher version than referenced assembly 'Micro soft.Extensions.DependencyInjection.Abstractions' with identity 'Microsoft.Extensions.DependencyInjection. Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' [C:\\api-logs\api-logs.csproj]
thanks
Don't worry! You can try to keep the same version you had previously of serilog-ui. (not sure if you were on 2.5.1)
You probably have a mismatch on one of its internal dependencies that was upgraded to NET 7.0.0 versions.
from serilog-ui.
Yes i was on 2.5.1, its a really basic dotnet core 6 web app,
before the upgrade to beta i had my csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>api_logs</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog.UI" Version="2.5.1" />
<PackageReference Include="Serilog.UI.MsSqlServerProvider" Version="2.2.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
</Project>
it builds and runs correctly.
when i upgrade to the beta version i get that error. i can try to downgrade the serilog.ui package, but didnt find yet a combination that works for me.
another thing i can try is to target to dotnet 7 instead of 6 maybe (im running on 6 because of my hosting provider).
from serilog-ui.
@followynne , it worked after i added this on my csproj
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0.0" />
from serilog-ui.
@followynne , and its working great!! 🎉
sorry for the "unrelated" posts, it may help someone in the future.
thanks for the help
from serilog-ui.
awesome news! Is it working out of the box or did you use the default parsing?
For the stable vrs, I'll have other feedbacks just to be sure 😊
from serilog-ui.
Related Issues (20)
- Deployed to developent, UI popup "You are not authorized to access logs" HOT 2
- Error Message column does not exist HOT 4
- BUG: when opening properties for the second time, the tags are escaped twice HOT 2
- Consider RavenDB support
- Any support for ColumnOptions? HOT 3
- Fails to insert data into MariaDB HOT 21
- Support provider name customization HOT 1
- UtcTimeStamp instead of TimeStamp in MongoDbDataProvider HOT 2
- Serilog UI version 3 is live!
- The url in v3 should end with a / else a 404 not found is returned HOT 3
- [feat] Auto-expand dropdowns option when opening 'Additional Columns' modal HOT 3
- Opening exception details tries to parse the field as XML rather than string for MSSQL HOT 10
- Exception occur if RemoveStandardColumn = "Properties" HOT 3
- /api/keys called on Change Token Button
- "Invalid column name 'Properties'." at Serilog UI Home Page, when removeStandardColumns: Properties. HOT 3
- When serilog column options properties are removed it does not fetch logs on UI #487 HOT 4
- Using options.Authorization.AuthenticationType = AuthenticationType.Jwt; in api project HOT 13
- When I am using MongoDb Sink provider Exception and properties column not populating in serilog.Ui HOT 8
- XML output isn't rendered correctly HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serilog-ui.