You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Cankut Eskin <ca...@gmail.com> on 2010/01/19 08:54:45 UTC

Re: Configure the debug value to true or false when needed through C# code

Use
log4net.Util.LogLog.InternalDebugging = false;

http://log4net.sourceforge.net/release/1.2.0.30316/doc/manual/faq.html#internalDebug

2010/1/19 Leo Mathew <le...@sonata-software.com>

>  Hi All,
>
>
>
> We are using log4Net in our application.
>
> We want to make the debugging of statements to be enabled or disabled.
>
>
>
> Is it possible to configure this by setting the below debug value to “true”
> or “false” through the C# code?
>
> <log4net debug="false">
>
>
>
> The above line is from log4Net.config file.
>
>
>
> Regards,
>
> Leo
>



-- 
Cankut Eskin

RE: Configure the debug value to true or false when needed through C# code

Posted by Leo Mathew <le...@sonata-software.com>.
Thanks. Removing of the debug attribute worked.

 

________________________________

From: Alasdair Richardson [mailto:alasdair.richardson@jabcap.com] 
Sent: Tuesday, January 19, 2010 1:31 PM
To: Log4NET User
Subject: RE: Configure the debug value to true or false when needed
through C# code

 

ot have you tried just removing the debug attribute (rather than setting
to false). It may be log4net just tests for the existence of the
attribute ..

	 

	
________________________________


	From: Alasdair Richardson
[mailto:alasdair.richardson@jabcap.com] 
	Sent: 19 January 2010 08:58
	To: Log4NET User
	Subject: RE: Configure the debug value to true or false when
needed through C# code

	Now I see what you are trying to do. This can be done in your
app.config too

	 

	  <!-- turns on log4net debugging (to stdout) -->
	  <!--appSettings>
	    <add key="log4net.Internal.Debug" value="true"/>
	  </appSettings-->

	 

		 

		
________________________________


		From: Cankut Eskin [mailto:cankuteskin@gmail.com] 
		Sent: 19 January 2010 08:55
		To: Log4NET User
		Subject: Re: Configure the debug value to true or false
when needed through C# code

		Use

		log4net.Util.LogLog.InternalDebugging = false;

		
	
http://log4net.sourceforge.net/release/1.2.0.30316/doc/manual/faq.html#i
nternalDebug

		2010/1/19 Leo Mathew <le...@sonata-software.com>

		Hi All,

		 

		We are using log4Net in our application.

		We want to make the debugging of statements to be
enabled or disabled. 

		 

		Is it possible to configure this by setting the below
debug value to "true" or "false" through the C# code?

		<log4net debug="false">

		 

		The above line is from log4Net.config file.

		 

		Regards,

		Leo

		
		
		
		-- 
		Cankut Eskin

	 


____________________________________
The information contained in this transmission is intended only for the
person or entity to which it is addressed and may contain confidential
and/or privileged information. If you are not the intended recipient (or
have received this e-mail in error) please notify the sender immediately
and delete this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.

 


____________________________________
The information contained in this transmission is intended only for the
person or entity to which it is addressed and may contain confidential
and/or privileged information. If you are not the intended recipient (or
have received this e-mail in error) please notify the sender immediately
and delete this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.

 


Re: Create new log files based on a variable value

Posted by Shekar <sh...@gmail.com>.
You can try like this:

1. Set the file name dynamically using GlobalContext [you can ThreadContext
as well] property which the user who logged in.

2. Load the config file using XmlConfigurator.Configure(ConfigFile).

3. Now use GetLogger(type())

Please let me know if it works fine.

On Wed, Jan 20, 2010 at 5:49 PM, Leo Mathew <le...@sonata-software.com>wrote:

>  Hi All,
>
>
>
> I am using Log4Net.
>
>
>
> Right now a log file is created based on the current date. So for each day
> we have a log file containing all the debug statements.
>
>
>
> We want to create a new log file based on a variable value in C#. For each
> activity we have a requestId. So for each activity we need to create a log
> file with the requestId.
>
>
>
> Is it possible?
>
>
>
> Regards,
>
> Leo
>

Create new log files based on a variable value

Posted by Leo Mathew <le...@sonata-software.com>.
Hi All,

 

I am using Log4Net.

 

Right now a log file is created based on the current date. So for each
day we have a log file containing all the debug statements.

 

We want to create a new log file based on a variable value in C#. For
each activity we have a requestId. So for each activity we need to
create a log file with the requestId.

 

Is it possible?

 

Regards,

Leo


RE: Configure the debug value to true or false when needed through C# code

Posted by Leo Mathew <le...@sonata-software.com>.
I will try both and let you know. Thanks in advance.

 

________________________________

From: Alasdair Richardson [mailto:alasdair.richardson@jabcap.com] 
Sent: Tuesday, January 19, 2010 1:31 PM
To: Log4NET User
Subject: RE: Configure the debug value to true or false when needed
through C# code

 

ot have you tried just removing the debug attribute (rather than setting
to false). It may be log4net just tests for the existence of the
attribute ..

	 

	
________________________________


	From: Alasdair Richardson
[mailto:alasdair.richardson@jabcap.com] 
	Sent: 19 January 2010 08:58
	To: Log4NET User
	Subject: RE: Configure the debug value to true or false when
needed through C# code

	Now I see what you are trying to do. This can be done in your
app.config too

	 

	  <!-- turns on log4net debugging (to stdout) -->
	  <!--appSettings>
	    <add key="log4net.Internal.Debug" value="true"/>
	  </appSettings-->

	 

		 

		
________________________________


		From: Cankut Eskin [mailto:cankuteskin@gmail.com] 
		Sent: 19 January 2010 08:55
		To: Log4NET User
		Subject: Re: Configure the debug value to true or false
when needed through C# code

		Use

		log4net.Util.LogLog.InternalDebugging = false;

		
	
http://log4net.sourceforge.net/release/1.2.0.30316/doc/manual/faq.html#i
nternalDebug

		2010/1/19 Leo Mathew <le...@sonata-software.com>

		Hi All,

		 

		We are using log4Net in our application.

		We want to make the debugging of statements to be
enabled or disabled. 

		 

		Is it possible to configure this by setting the below
debug value to "true" or "false" through the C# code?

		<log4net debug="false">

		 

		The above line is from log4Net.config file.

		 

		Regards,

		Leo

		
		
		
		-- 
		Cankut Eskin

	 


____________________________________
The information contained in this transmission is intended only for the
person or entity to which it is addressed and may contain confidential
and/or privileged information. If you are not the intended recipient (or
have received this e-mail in error) please notify the sender immediately
and delete this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.

 


____________________________________
The information contained in this transmission is intended only for the
person or entity to which it is addressed and may contain confidential
and/or privileged information. If you are not the intended recipient (or
have received this e-mail in error) please notify the sender immediately
and delete this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.

 


RE: Configure the debug value to true or false when needed through C# code

Posted by Alasdair Richardson <al...@jabcap.com>.
ot have you tried just removing the debug attribute (rather than setting
to false). It may be log4net just tests for the existence of the
attribute ..


________________________________

	From: Alasdair Richardson
[mailto:alasdair.richardson@jabcap.com] 
	Sent: 19 January 2010 08:58
	To: Log4NET User
	Subject: RE: Configure the debug value to true or false when
needed through C# code
	
	
	Now I see what you are trying to do. This can be done in your
app.config too
	 
	  <!-- turns on log4net debugging (to stdout) -->
	  <!--appSettings>
	    <add key="log4net.Internal.Debug" value="true"/>
	  </appSettings-->
	
	 


________________________________

		From: Cankut Eskin [mailto:cankuteskin@gmail.com] 
		Sent: 19 January 2010 08:55
		To: Log4NET User
		Subject: Re: Configure the debug value to true or false
when needed through C# code
		
		
		Use
		
		log4net.Util.LogLog.InternalDebugging = false;
		

	
http://log4net.sourceforge.net/release/1.2.0.30316/doc/manual/faq.html#i
nternalDebug
		
		
		2010/1/19 Leo Mathew <le...@sonata-software.com>
		

			Hi All,

			 

			We are using log4Net in our application.

			We want to make the debugging of statements to
be enabled or disabled. 

			 

			Is it possible to configure this by setting the
below debug value to "true" or "false" through the C# code?

			<log4net debug="false">

			 

			The above line is from log4Net.config file.

			 

			Regards,

			Leo




		-- 
		Cankut Eskin
		




____________________________________
The information contained in this transmission is intended only for the
person or entity to which it is addressed and may contain confidential
and/or privileged information. If you are not the intended recipient (or
have received this e-mail in error) please notify the sender immediately
and delete this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
	

____________________________________
The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

RE: Configure the debug value to true or false when needed through C# code

Posted by Alasdair Richardson <al...@jabcap.com>.
Now I see what you are trying to do. This can be done in your app.config
too
 
  <!-- turns on log4net debugging (to stdout) -->
  <!--appSettings>
    <add key="log4net.Internal.Debug" value="true"/>
  </appSettings-->

 


________________________________

	From: Cankut Eskin [mailto:cankuteskin@gmail.com] 
	Sent: 19 January 2010 08:55
	To: Log4NET User
	Subject: Re: Configure the debug value to true or false when
needed through C# code
	
	
	Use
	
	log4net.Util.LogLog.InternalDebugging = false;
	

	
http://log4net.sourceforge.net/release/1.2.0.30316/doc/manual/faq.html#i
nternalDebug
	
	
	2010/1/19 Leo Mathew <le...@sonata-software.com>
	

		Hi All,

		 

		We are using log4Net in our application.

		We want to make the debugging of statements to be
enabled or disabled. 

		 

		Is it possible to configure this by setting the below
debug value to "true" or "false" through the C# code?

		<log4net debug="false">

		 

		The above line is from log4Net.config file.

		 

		Regards,

		Leo




	-- 
	Cankut Eskin
	

____________________________________
The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.