I tried to login after adding log4net to create logs in the Postgres SQL Database but, failed to login.
The issue is “ERROR: {code: 0, message: ‘An internal error occurred during your request!’, details: null, validationErrors: null}” from the console.
This code is in log4net.config file, I tried using below code for datetime parameter to insert logs into DataBase.
1) <parameter>
<parameterName value="@log_date" />
<dbType value="DateTime" />
<layout type="log4net.Layout.RawUtcTimeStampLayout" />
</parameter>
This code works and inserts Logs into DB. But, an exception mentioned in the Title is appearing which is causing login failure with a message, “An internal error occurred during your request!”
Note: If there is no DateTime parameter in log4net.config file also causing the same exception as in screenshot.
Added this code to clear errors on the server side exception:
DateTime dateTimeValue = yourDateTimeValue.ToUniversalTime(); DateTime unspecifiedDateTime = DateTime.SpecifyKind(dateTimeValue, DateTimeKind.Unspecified);
CREATE TABLE log(
id SERIAL PRIMARY KEY,
log_date TIMESTAMP WITH TIME ZONE NOT NULL,
thread VARCHAR(255),
log_level VARCHAR(50),
logger VARCHAR(255),
message TEXT,
exception TEXT
);
The Error maybe “DateTime” dbType in .NET object is not able to map with Postgres SQL.
Hope, this helps you understand the problem.