Try our conversational search powered by Generative AI!

How to log exceptions into database using log4net in DXC environment


Hi Team,

Can anyone please suggest best practices to log errors into database using existing log4net in DXC environment?

As of now, Default DXC environment logging is enabled but i want to override and save to database for better use. so i can also log any DEBUG or information logs as well into database.

Feb 19, 2020 15:55

Logging into database is generally not a good idea, especially in managed environments like DXC. if you are logging too much you can bring down your database. Why would you want to log DEBUG/INFO messages to database?

Feb 19, 2020 16:14

Hi Quan,

For better accessing the logs i am thinking to go for database. Is there any better way of logging DEBUG/INFO messages into DXC environment? Can you please suggest?

Currently, i have implemented lot of transactional operations apart from regular CMS features. So sometimes i need to log the output of anyone of transaction method to troubleshoot any response.

Feb 19, 2020 16:43

Hi Suresh

You can configure Log4net database appender to achieve what you need. As Quan said previously, it's not a good idea and recommended. From memory, the PAAS portal has provided access to Application Log from both stream and csv export. If you have Azure portal access, you can access to application insight as well.

Feb 20, 2020 3:10

Hi Vincent,

Yes i am able to access the logs from paasportal. But these are error logs.

As of now it is only logging errors. Is there any way of logging any DEBUG/INFO logs into DXC environment?

Feb 20, 2020 3:57

I believe you can set the logging level, as well as connect to the logging stream for such information

Feb 20, 2020 6:32
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.