I am writing Audit Log into postgres database using .net core. I am following article Audit.WebAPI. everything working fine. log write properly in database. My requirement is pass some other information while logging into database, but i am not able to do that. Please help me.
Postgresql table:
CREATE TABLE log.auditlog
(
id integer NOT NULL DEFAULT nextval('log.auditlog_id_seq'::regclass),
inserted_date timestamp without time zone NOT NULL DEFAULT now(),
updated_date timestamp without time zone NOT NULL DEFAULT now(),
data jsonb NOT NULL,
module character varying(100),
CONSTRAINT auditlog_pkey PRIMARY KEY (id)
)
Here I add extra column name as module and want to set data into it.
.Net Core
Audit.Core.Configuration.DataProvider = new PostgreSqlDataProvider()
{
ConnectionString = "Server=localhost;Port=5432;User Id=postgres;Password=1234;Database=postgres;",//Local
TableName = "auditlog",
IdColumnName = "id",
DataColumnName = "data",
DataType = "JSONB",
Schema = "log",
LastUpdatedDateColumnName = "updated_date"
};
Through .NET Core for audit logging any other suggesting will be good.