hi, i want to logging exception details to sqlite database using Nlog libraries, m okay when i store logging details by using ado.net code but m not able to insert log details when i use nlog.config. please help me out how can i insert logging details by nlog.config.
here is my code----------------- <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="false"> <targets> <target name="file" xsi:type="File" layout=" ---------------------------------------------------${newline} ${longdate} ${newline} ---------------------------------------------------------${newline} Level: ${level}${newline} User Id: ${aspnet-User-Identity} Action: ${aspnet-MVC-Action}${newline} Controller: ${aspnet-MVC-Controller}${newline} Ip: ${aspnet-Request-IP}${newline} Call Site: ${callsite} ${newline} ${logger}${newline} ${message}${newline} ${exception:format=message}${newline} ${exception:format=:innerFormat=ShortType,Message,Method:MaxInnerExceptionLevel=1:InnerExceptionSeparator=}${newline} " fileName="D:/ErrorLog/example.log" keepFileOpen="false" encoding="iso-8859-2" /> <target name="db" xsi:type="Database" dbProvider="System.Data.SQLite" keepConnection="false" connectionString="Data Source=$C:\Users\abhijitd\Desktop\Test\Log.db3;Version=3;" commandText="INSERT into Log(Time, SeverityLevel, ClassName, LogText) values(@Time, @SeverityLevel, @ClassName, @LogText)"> <parameter name="@Time" layout="${longdate}"/> <parameter name="@SeverityLevel" layout="${level:uppercase=true}"/> <parameter name="@ClassName" layout="${aspnet-MVC-Controller}"/> <parameter name="@LogText" layout="${message}"/> </target> </targets> <rules> <logger name="*" minlevel="Warn" writeTo="db" /> <logger name="*" minlevel="Warn" writeTo="file" /> </rules> </nlog> Thanks and regards Abhijit Dass _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users