Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using webapplicaton and i am able to store the log error(default which is provided by log4net)in the table.

But i want to add some more column and want to store the error in that field to.

CREATE TABLE [dbo].[Log] (

[Id] [int] IDENTITY (1, 1) NOT NULL,

[Date] [datetime] NOT NULL,

[Thread] [varchar] (255) NOT NULL,

[Level] [varchar] (50) NOT NULL,

[Logger] [varchar] (255) NOT NULL,

[Message] [varchar] (4000) NOT NULL,

[Exception] [varchar] (2000) NULL

)


Now want to increase the 3 column in above table.
1. ErrorSource
2. ErrorCode(API Status Error Code)
3. StackTrace

So how can i use custom log using log4net library?

Any help would be appreciated?

What I have tried:

How to store log in database using log4net | Sadi02's Weblog[^]

I have used above link and successfully saving the log. Now So how can i use custom log using log4net library?
Posted
Updated 31-Jan-18 1:56am

1 solution

Please close this question. I just figure out the issue. Below is the link. Thanks.

c# - Log4Net, how to add a custom field to my logging - Stack Overflow[^]
 
Share this answer
 
Comments
Adityakumar2318 15-Feb-18 12:37pm    
Now i want to use two tables (Parent/Child table)? how to use that?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900