 |
|
 |
I use log4NET in my web app and all was working correctly .. i used log4net to write a log into a table in my database in MS SQL Server 2005 , but about 4 days ago the log4net stop to do it , when I trace the transactions in the database I found this:
The log4net change my insert query to this :
exec sp_execute 1 (values) and the log was working fine , but suddenly change to this:
exec sp_execute -1 (values) and stop the write.
My question is : why the log4net would change : exec sp_execute 1 to exec sp_execute -1
.. hope someone understand my problem ...
thanks
-S.
|
|
|
|
 |
|
 |
Log4Net is giving proper logs when i use with Exe`s. But not with Class Libraries. I followed same steps in both exe and library. But its not writing logs in case of dll.
I followed following steps...
1. Added log4net.dll in references
2. In assemblyInfo.vb file added (<Assembly: log4net.Config.XmlConfigurator()> )
3. In class file declared (Private Shared ReadOnly log As ILog = LogManager.GetLogger("Log4NetLib"))
4. Added app.config file
5. In function i added logs like (log.Debug("..........."))
Works fine for exe but not dll.
Am i doing anything wrong? can you please advice me?
Thanks in advance
-Surya
Surya
|
|
|
|
 |
|
 |
Hi Do we have any property in Log4Net so that we can set in the configuration file and turn it off for the time being.
gfhgf
|
|
|
|
 |
|
 |
You can achieve it by setting "threshold" attribute to "OFF" For example: <log4net threshold="OFF" debug="true">
|
|
|
|
 |
|
 |
Thanks for writing this page, it was very helpful.
Log4net samples are so poorely documented, that starting logging can take up to hours . Getting it to work is definately the worst (and maybe only?) problem of log4net.
Anyway, once again thanks a lot!
Alain.
|
|
|
|
 |
|
|
 |
|
 |
Hi,
how can I customize the header and footer? I wanna have the following information in the header:
- "program start: " + System.DateTime.Now().ToString
- "computer: " + System.Environment.MachineName()
- "User: " + System.Environment.UserDomainName + "\" + System.Environment.UserName
- "application: " + System.Diagnostics.Process.GetCurrentProcess.ProcessName
In the footer I wanna write:
- "_______________________________________________________________________"
- "program end: " + System.DateTime.Now().ToString
- "execution time: " + blabla
Is this possible?
And I got another question: Can I set another location of the config.xml instead of the application directory?
thx in advance!
jason_x
|
|
|
|
 |
|
 |
Do you have any suggestions as to how to use log4net and SP 2007 webparts? Do I still put the configuration settings in web.config event though all webparts use the same web.config? Thanks.
|
|
|
|
 |
|
 |
It's not working in .net 2.0
|
|
|
|
 |
|
 |
Yes it is, just download the latest log4net dll
|
|
|
|
 |
|
 |
Its not working still... Everything builds fine... but while running, its not writting to any file...
|
|
|
|
 |
|
 |
Please make sure that log4net is initialized - check the article for details.
Also if you specify in your config section log4net with attribute debug="true" and start the application in debugger on your output window you will see the potential error messages.
If you don't see any - you have not log4net properly initilaized - check the article for details.
Hope this helps.
|
|
|
|
 |
|
 |
Sir,
I have an asp.net application that uses log4net for logging purpose. And i want to integrate my application with the other asp.net application i.e. host application. the problem comes here i want to log both application in two different log files.
(This is a integrated environment)
How can i solve this , plz help me out.
Thanks in advance
Ravindra
|
|
|
|
 |
|
 |
It's not working in my side...
|
|
|
|
 |
|
 |
Can you provide the error description.
|
|
|
|
 |
|
|
 |
|
 |
Definitely Nlog is good alternative & I appreciate your work. Only the difference I see at this point of time is that log4net is more stable and widely used.
|
|
|
|
 |
|
 |
This is not working for me ??
|
|
|
|
 |
|
 |
What problem you are facing? Can you provide me the error message?
|
|
|
|
 |
|
 |
A small change is required if you are using log4net ver. 1.2.10
Change below line written in AssemblyInfo.cs
[assembly: log4net.Config.DOMConfigurator(ConfigFile="Web.config", Watch=true)]
to
[assembly: log4net.Config.XmlConfigurator(ConfigFile="Web.config", Watch=true)]
I used version 1.2.0.30507 of log4net for above article.
|
|
|
|
 |
|
 |
No more outsourcing for you
|
|
|
|
 |