Click here to Skip to main content
15,119,786 members
Articles / Desktop Programming / WPF
Posted 3 Jun 2015


21 bookmarked

Easy Log Viewer. Yet another log viewer tool, but Easier.

Rate me:
Please Sign up or sign in to vote.
2.67/5 (9 votes)
3 Jun 2015Ms-RL2 min read
Easy Log Viewer is a tool which helps developers to easier view logs,


Easy Log Viewer is a tool which helps developers to easier view logs, it contains these features:

1: Support all kinds of logs, ( Windows Event Log, CSV Logs, XML logs, text logs, database logs ...).

  • Open Window Event Log (Application).

    Image 1

  • Open CSV file:

    Image 2

  • Open XML file

    Image 3

  • Open Text file:

    Image 4

2: Easy to filter and search , I guess nobody want the viewer doesn't support this feature.

Image 5

Click Find Previous or Find Next to navigate between Find what:

Image 6

3: The feature should powerful, should support Contains, NotContains, StartsWith, Equal, Regex... , So I can easier to filter logs.

Image 7

4: highligh based on filters, Sometimes I want to highlight the interest items.

Image 8

5: hide or show some log records, This will allow me to focus on the log which I interested in.

Image 9

6: Bookmark support. Like Visual Studio , navigation in bookmark is easier.

Image 10

7: Annotation support, Sometimes I want to add some comments to log, so when I send them to others, other can see my comments.

Image 11

8: Save the log, It should save the log and the settings of the Log.

9: The UI should be stupid and simple, and powerful, It should be easy to use, and easy to rearrange, and support full screen mode.

Free Style

Image 12

Full Screen Mode

Image 13

Image 14


There're lots of logging framework, like log4j, log4net, NLog, Microsoft Enterprise Logging Framework...

These logging frameworks help developer to Log messages in application, with these frameworks, You can log your messages to DB, to Console, to File, to other computers, to what ever you want.

However I found there is NO Log Viewer Tool which support all kinds of logging targets.

Some tool only support one kinds of Logging format, and some doesn't have the feature I want, That's why I created this tool!.

Using the code

EasyLogViewer support plugin,

For example, if you want to read your log entries from other places,

  1. Create a project , and add reference to EasyLogViewer.IHandler.dll
  2. Implement the IReadLogFileHandler interface,
  3. Put the build bin folder to Plugins folder, like other plugin does.
namespace EasyLogViewer.IHandler
    public interface IReadLogFileHandler : IBaseHandler
        object Execute(string fileName, Action<IEnumerable<ExpandoObject>> newLogEntriesCallback, HandledEventArgs args);

Below is an example of how to write a text file reader:

public class LineFileHandler : IReadLogFileHandler
	public int Priority
		get { return Int32.MinValue; }

	public object Execute(string fileName, Action> newLogEntriesCallback,HandledEventArgs args)
		var result = new List<ExpandoObject>();
		using (FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
			using (var sr = new StreamReader(fs))
				while (sr.Peek() >= 0)
					dynamic obj = new ExpandoObject();
					obj.Message = sr.ReadLine();


		args.Handled = true;

		return result;

Your plugin will be executed by PluginManager class.

public static class PluginManager
		private static readonly Dictionary<object, object=""> pluginCache = new Dictionary<object, object="">();
		private static readonly List<type> pluginTypes = new List<type>();

		public static void LoadPlugins()
			foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())

			// load 3rd last.
			string[] pluginFolders = Directory.GetDirectories("Plugins");
			foreach (string pluginFolder in pluginFolders)
				string[] files = Directory.GetFiles(pluginFolder, "*.dll");

				foreach (string file in files)
					Assembly assembly = Assembly.LoadFrom(Environment.CurrentDirectory + "\\" + file);

					//Assembly assembly = AppDomain.CurrentDomain.Load(Environment.CurrentDirectory + "\\" + file);


		public static object RunPlugins<t>(this object owner, params object[] handleArgs) where T : IBaseHandler
			object result = null;

			var eventArgs = new HandledEventArgs(false);

			List<object>newArgs = handleArgs.ToList();
			object[] combineArgs = newArgs.ToArray();

			List<t> handlers = GetPlugins<t>(owner);
			MethodInfo methodInfo = null;
			foreach (T handler in handlers)
					if (methodInfo == null)
						methodInfo = typeof(T).GetMethod("Execute");

					if (eventArgs.Handled == false)
						result = methodInfo.Invoke(handler, combineArgs);

						if (eventArgs.Handled)
							EventLogHelper.LogInformation(string.Format("Parse Log Success {0}", handler));
				catch (Exception ex)
					//swallow this exception, do the next parser.
					EventLogHelper.LogError("This plugin has error,...", ex);

			return result;

		private static List<t> GetPlugins<t>(object owner) where T : IBaseHandler
			if (!pluginCache.ContainsKey(owner) ||
				List<type> matchPluginTypes = pluginTypes.Where(t => t.Implements<t>()).ToList();

				List<object> plugins =
					(from matchPluginType in matchPluginTypes
					 where matchPluginType.IsClass
					 select Activator.CreateInstance(matchPluginType)).ToList();

				pluginCache[owner] = plugins;

			return pluginCache[owner]
				.OrderByDescending(t => t.Priority)

		private static void LoadPlugins(Assembly assembly)
			IList<type> types = assembly.TypesImplementing<ibasehandler>();
			foreach (Type type in types)

Please notice the RunPlugins<T> method, this method will pass the parameters to plugin, and run the Execute method by reflection.

So what's next?

Features still outstanding for EasyLogViewer:

  • Export logs in several formats (CSV, XML,...).
  • Highlight the method Enter and Exit,
  • Group methods.
  • Group filters, so filters can And/Or.
  • Column Display Plugin.
  • Quick navigate between find logs.
  • Got any ideas you'd like to share? Ping me.

Points of Interest


30 May 2015: Version 1.0

  • Initial release.


This article, along with any associated source code and files, is licensed under Microsoft Reciprocal License


About the Author

United States United States
No Biography provided

Comments and Discussions

QuestionWhere find EasyLogViewer ? Pin
pleveill29-Dec-15 13:01
Memberpleveill29-Dec-15 13:01 
AnswerRe: Where find EasyLogViewer ? Pin
LoveJenny29-Dec-15 22:47
MemberLoveJenny29-Dec-15 22:47 
GeneralRe: Where find EasyLogViewer ? Pin
pleveill30-Dec-15 2:48
Memberpleveill30-Dec-15 2:48 
GeneralRe: Where find EasyLogViewer ? Pin
Member 244330626-Oct-17 2:41
MemberMember 244330626-Oct-17 2:41 
It's still not there. Any news on that?
QuestionHow can I view Windows Events Security log ? Pin
Kiliuszkin115-Aug-15 1:15
MemberKiliuszkin115-Aug-15 1:15 
AnswerRe: How can I view Windows Events Security log ? Pin
LoveJenny6-Aug-15 17:00
MemberLoveJenny6-Aug-15 17:00 
GeneralRe: How can I view Windows Events Security log ? Pin
Kiliuszkin116-Aug-15 23:03
MemberKiliuszkin116-Aug-15 23:03 
GeneralRe: How can I view Windows Events Security log ? Pin
LoveJenny7-Aug-15 0:01
MemberLoveJenny7-Aug-15 0:01 
GeneralRe: How can I view Windows Events Security log ? Pin
Kiliuszkin117-Aug-15 6:30
MemberKiliuszkin117-Aug-15 6:30 
SuggestionPlugins and MEF Pin
kiquenet.com12-Jun-15 5:12
professionalkiquenet.com12-Jun-15 5:12 
GeneralRe: Plugins and MEF Pin
LoveJenny14-Jun-15 16:48
MemberLoveJenny14-Jun-15 16:48 
QuestionOther viewer Pin
kiquenet.com12-Jun-15 2:15
professionalkiquenet.com12-Jun-15 2:15 
AnswerRe: Other viewer Pin
LoveJenny14-Jun-15 16:49
MemberLoveJenny14-Jun-15 16:49 
GeneralMy vote of 5 Pin
Prafulla Hunde3-Jun-15 9:26
MemberPrafulla Hunde3-Jun-15 9:26 
GeneralRe: My vote of 5 Pin
LoveJenny3-Jun-15 13:54
MemberLoveJenny3-Jun-15 13:54 
QuestionWhere is the source? Pin
James Huebsch3-Jun-15 8:28
MemberJames Huebsch3-Jun-15 8:28 
AnswerRe: Where is the source? Pin
LoveJenny3-Jun-15 13:56
MemberLoveJenny3-Jun-15 13:56 
QuestionFailed to load resource: the server responded with a status of 404 (File Not Found) Pin
Anders Eriksson3-Jun-15 7:14
MemberAnders Eriksson3-Jun-15 7:14 

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.