Click here to Skip to main content
15,895,142 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to implement Keybord shortcuts in a C# window application Pin
Giorgi Dalakishvili8-Dec-08 19:21
mentorGiorgi Dalakishvili8-Dec-08 19:21 
GeneralRe: how to implement Keybord shortcuts in a C# window application Pin
TJS4u8-Dec-08 19:27
TJS4u8-Dec-08 19:27 
GeneralRe: how to implement Keybord shortcuts in a C# window application Pin
Giorgi Dalakishvili8-Dec-08 19:30
mentorGiorgi Dalakishvili8-Dec-08 19:30 
GeneralRe: how to implement Keybord shortcuts in a C# window application Pin
Seraph_summer8-Dec-08 23:53
Seraph_summer8-Dec-08 23:53 
GeneralRe: how to implement Keybord shortcuts in a C# window application Pin
Giorgi Dalakishvili8-Dec-08 23:55
mentorGiorgi Dalakishvili8-Dec-08 23:55 
QuestionShould side-effect free function using Properties? Pin
calendarw8-Dec-08 17:58
calendarw8-Dec-08 17:58 
AnswerRe: Should side-effect free function using Properties? Pin
Vikram A Punathambekar8-Dec-08 18:57
Vikram A Punathambekar8-Dec-08 18:57 
QuestionCant see output to Event log with log4net EventLogAppender. Pin
Chintan.Desai8-Dec-08 17:25
Chintan.Desai8-Dec-08 17:25 
Hi Guys,

I want to write to event log with log4net eventlogappender, but could not get the output in event log. Below is my code snippets

<code>Creating root</code>
Hierarchy root=(Hierarchy) log4net.LogManager.CreateRepository("trial");
			root.Configured=true;
			root.Root.Level=log4net.Core.Level.Warn;
			log4net.ILog log=log4net.LogManager.GetLogger("trial",root.Name);
			log4net.Repository.Hierarchy.Logger loggerRepo=(log4net.Repository.Hierarchy.Logger)log.Logger;
			
			<code>create layout</code>
			log4net.Layout.PatternLayout objPatterLayout=new log4net.Layout.PatternLayout("Date:%d,Thread:[%t]");
			

			<code>add appender to root after setting its properties</code>
			EventLogAppender appenderEventLog=new EventLogAppender();
			appenderEventLog.MachineName=".";//local machine.
			appenderEventLog.LogName="System";
			appenderEventLog.ApplicationName="trial apps";
					          appenderEventLog.Layout=objPatterLayout;
			appenderEventLog.ActivateOptions();
			
			loggerRepo.AddAppender(appenderEventLog);


			//try to log
			log4net.ILog log2=log4net.LogManager.GetLogger("trial",typeof(Form1).Name);
			if(log2.IsErrorEnabled)
				log2.Error("Error from trial apps");
			if(log2.IsInfoEnabled)
				log2.Warn("info from trial apps");


I use to get IsErrorEnabled as true, but cant see the output. I think I am missing Source, but there is no property to set the source.

Pls let me know, if I miss any properties.

thanx in advance.

Thanks,
Chintan(India)

AnswerRe: Cant see output to Event log with log4net EventLogAppender. Pin
Giorgi Dalakishvili8-Dec-08 19:22
mentorGiorgi Dalakishvili8-Dec-08 19:22 
GeneralRe: Cant see output to Event log with log4net EventLogAppender. Pin
Chintan.Desai8-Dec-08 22:34
Chintan.Desai8-Dec-08 22:34 
QuestionEvent Log Madness - Changing the log associated with a log Pin
prod@pt8-Dec-08 14:28
prod@pt8-Dec-08 14:28 
AnswerRe: Event Log Madness - Changing the log associated with a log Pin
Chintan.Desai8-Dec-08 19:09
Chintan.Desai8-Dec-08 19:09 
Questionvalidation of class attributes Pin
devvvy8-Dec-08 14:05
devvvy8-Dec-08 14:05 
AnswerRe: validation of class attributes Pin
PIEBALDconsult8-Dec-08 14:17
mvePIEBALDconsult8-Dec-08 14:17 
GeneralRe: validation of class attributes Pin
devvvy8-Dec-08 14:27
devvvy8-Dec-08 14:27 
GeneralRe: validation of class attributes Pin
PIEBALDconsult8-Dec-08 14:34
mvePIEBALDconsult8-Dec-08 14:34 
AnswerRe: validation of class attributes Pin
N a v a n e e t h8-Dec-08 16:27
N a v a n e e t h8-Dec-08 16:27 
GeneralRe: validation of class attributes Pin
devvvy8-Dec-08 17:11
devvvy8-Dec-08 17:11 
GeneralRe: validation of class attributes Pin
N a v a n e e t h8-Dec-08 19:58
N a v a n e e t h8-Dec-08 19:58 
Questionderived class to automatically call base method before "return" Pin
devvvy8-Dec-08 13:56
devvvy8-Dec-08 13:56 
AnswerRe: derived class to automatically call base method before "return" Pin
PIEBALDconsult8-Dec-08 14:12
mvePIEBALDconsult8-Dec-08 14:12 
AnswerRe: derived class to automatically call base method before "return" Pin
Christian Graus8-Dec-08 14:14
protectorChristian Graus8-Dec-08 14:14 
AnswerRe: derived class to automatically call base method before "return" Pin
Thomas Weller9-Dec-08 3:12
Thomas Weller9-Dec-08 3:12 
QuestionHow can I get "Struct's address"~ help me~ Pin
G.I Cho8-Dec-08 13:03
G.I Cho8-Dec-08 13:03 
GeneralRe: How can I get "Struct's address"~ help me~ Pin
Luc Pattyn8-Dec-08 13:24
sitebuilderLuc Pattyn8-Dec-08 13:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.