How can I change log4net to log in my MySql database?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
7/26/2010 9:50:05 AM
Gravatar
Total Posts 1

How can I change log4net to log in my MySql database?

Hello everyone,

 

I'm a newbie to MojoPortal, evaluating it for some weeks, probably going to use it in a new project coming in.

Everything in mojo seems very easy and straight-forward. However I'm not figuring out how to change my System Log to write in my database instead of file system. I already created the "Log" table in MySql  log4net database, and changed log4net.config appender to something like:

<appender name="ADONetAppender" type="log4net.Appender.ADONetAppender">
<bufferSize value="1"/>
<connectionType value="MySql.Data.MySqlClient.MySqlConnection, MySql.Data"/>
<connectionString value="server=localhost;uid=mojouser;pwd=mojo123;database=log4net;"/>
<commandText value="INSERT INTO Log Date,Thread,Level,Logger,Message,Exception,Context) VALUES (?log_date, ?thread, ?log_level, ?logger, ?message, ?exception, ?context)"/>
<parameter>

.......... </appender>

changed the appender ref as follows:

<appender-ref ref="ADONetAppender"/>

and commented the lines refering and defining RollingLogFileAppender.

What am I doing wrong?

I'm using Windows 7, MySQL database and MojoPortal 2.3.4.5

 

Cheers,

Carlos

 

 

 

You must sign in to post in the forums. This thread is closed to new posts.