﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>LogViewPlus Support » LogViewPlus Support » Configuration &amp; Customization  » Post Processing</title><generator>InstantForum 2017-1 Final</generator><description>LogViewPlus Support</description><link>https://www.logviewplus.com/forum/</link><webMaster>LogViewPlus Support</webMaster><lastBuildDate>Fri, 15 May 2026 23:32:24 GMT</lastBuildDate><ttl>20</ttl><item><title>Post Processing</title><link>https://www.logviewplus.com/forum/post/871</link><description>Good morning!&lt;br/&gt;&lt;br/&gt;I edited the CustomParser template to adapt LogViewPlus to the type of my logs, and it works fine.&lt;br/&gt;What I did there it just introduces the Priority based on some string in my log lines.&lt;br/&gt;&lt;br/&gt;Now I would like to Implement a post-processor where if the message in the log entry contains the word "error" it changes the priority of the line to "Error".&lt;br/&gt;&lt;br/&gt;In the CustomParser i would use this:&lt;br/&gt;&lt;br/&gt;[code]           newEntry.Priority = "Info";&lt;br/&gt;            if (logLine.Contains("error"))&lt;br/&gt;                {&lt;br/&gt;                newEntry.Priority = "Error";&lt;br/&gt;                }[/code]&lt;br/&gt;&lt;br/&gt;But it's not working in the PostProcessor.&lt;br/&gt;Any hint how do I do it?&lt;br/&gt;&lt;br/&gt;Thanks in Advance for any advise!&lt;br/&gt;</description><pubDate>Thu, 17 Dec 2020 16:11:14 GMT</pubDate><dc:creator>dv1sual</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/880</link><description>Glad to that helped.&amp;nbsp; Thanks for letting me know.&amp;nbsp; :-)&lt;br/&gt;&lt;br/&gt;Toby</description><pubDate>Thu, 17 Dec 2020 16:11:14 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/879</link><description>Hi Toby,&lt;br/&gt;&lt;br/&gt;you're a legend.&lt;br/&gt;&lt;br/&gt;I didn't add the post-processor to the parser.&lt;br/&gt;The code is working fine!&lt;br/&gt;&lt;br/&gt;Thanks so much for your help, you made my day!&lt;br/&gt;&lt;br/&gt;Cheers!</description><pubDate>Thu, 17 Dec 2020 16:09:48 GMT</pubDate><dc:creator>dv1sual</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/878</link><description>Thanks for the update.&lt;br/&gt;&lt;br/&gt;When you put a break point in your code, is it being called?&amp;nbsp; Have you added the post processor to your parser configuration?</description><pubDate>Thu, 17 Dec 2020 16:04:46 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/877</link><description>Hi Toby,&lt;br/&gt;&lt;br/&gt;When I'm saying is not working I mean that when I open up my log, all the lines that contain the word "test" are not changed to "Error" Priority, but they stay in "Info".&lt;br/&gt;&lt;br/&gt;I'm compiling and launching it from Visual Studio, and I can see that my parser works fine (the log level are added to the log) but nothing from the PostProcessor side.&lt;br/&gt;&lt;br/&gt;Thanks for your help so far.</description><pubDate>Thu, 17 Dec 2020 16:02:06 GMT</pubDate><dc:creator>dv1sual</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/876</link><description>The code looks fine.&amp;nbsp; When you say it doesn't work - what do you mean?&amp;nbsp; How is it now working?&amp;nbsp; Is your code being called?&lt;br/&gt;&lt;br/&gt;I would suggest debugging to see if the OriginalLogEntry contains the text you are expecting.&lt;br/&gt;&lt;br/&gt;Toby</description><pubDate>Thu, 17 Dec 2020 15:54:38 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/875</link><description>Hi Toby.&lt;br/&gt;&lt;br/&gt;yes, was a compile error. &lt;br/&gt;Now it compiles it, and it runs LogViewPlus, but it actually doesn't work.&lt;br/&gt;&lt;br/&gt;But that's my problem, I think somewhere in the Parser.&lt;br/&gt;Would you mind to look at the full Post Processor code and tell me if you think is all right?&lt;br/&gt;&lt;br/&gt;[code]using Clearcove.LogViewer.Common;&lt;br/&gt;using System;&lt;br/&gt;using System.Collections.Generic;&lt;br/&gt;using System.Configuration;&lt;br/&gt;using System.Diagnostics;&lt;br/&gt;using System.Globalization;&lt;br/&gt;using System.Reflection;&lt;br/&gt;&lt;br/&gt;namespace CustomPostProcessor&lt;br/&gt;{&lt;br/&gt;   &lt;br/&gt;    public class MyPostProcessor : ILogPostProcessor&lt;br/&gt;    {&lt;br/&gt;       &lt;br/&gt;        public void Modify(LogEntry newEntry)&lt;br/&gt;        {&lt;br/&gt;&lt;br/&gt;            newEntry.Priority = "Info";&lt;br/&gt;            if (newEntry.OriginalLogEntry.Contains("test"))&lt;br/&gt;            {&lt;br/&gt;                newEntry.Priority = "Error";&lt;br/&gt;            }&lt;br/&gt;&lt;br/&gt;        }&lt;br/&gt;&lt;br/&gt;    }&lt;br/&gt;}[/code]&lt;br/&gt;&lt;br/&gt;Anything I'm missing that you can spot?&lt;br/&gt;&lt;br/&gt;Thanks again for your patience.&lt;br/&gt;&lt;br/&gt;L.</description><pubDate>Thu, 17 Dec 2020 15:34:54 GMT</pubDate><dc:creator>dv1sual</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/874</link><description>That's interesting.&amp;nbsp; It looks like a compile error rather than a runtime issue.&lt;br/&gt;&lt;br/&gt;In your parser 'logLine' is a String.&amp;nbsp; String objects have a Contains method.&lt;br/&gt;&lt;br/&gt;In the finalizer, you receive a&amp;nbsp;LogEntry.&amp;nbsp; Not a String, but it does contain Strings.&amp;nbsp; Try newEntry.OriginalLogEntry.Contains().&lt;br/&gt;&lt;br/&gt;Hope that helps,&lt;br/&gt;&lt;br/&gt;Toby</description><pubDate>Thu, 17 Dec 2020 14:07:46 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/873</link><description>Hi Toby,&lt;br/&gt;&lt;br/&gt;yes, i'm doing the debugging in Visual Studio.&lt;br/&gt;It gave me this:&lt;br/&gt;&lt;br/&gt;[code]Error&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CS1061&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'LogEntry' does not contain a definition for 'Contains' and no accessible extension method 'Contains' accepting a first argument of type 'LogEntry' could be found (are you missing a using directive or an assembly reference?)&lt;br/&gt;[/code]&lt;br/&gt;&lt;br/&gt;I used that code easily in Parser, but not editing the post-processing file.&lt;br/&gt;I'm sorry if this sounds obvious, i just have little knowledge in C#.&lt;br/&gt;&lt;br/&gt;Let me know if i can provide more info to being able to help you help me with this.&lt;br/&gt;&lt;br/&gt;Thanks!</description><pubDate>Thu, 17 Dec 2020 13:33:57 GMT</pubDate><dc:creator>dv1sual</dc:creator></item><item><title>RE: Post Processing</title><link>https://www.logviewplus.com/forum/post/872</link><description>Good Morning!&amp;nbsp; :-)&lt;br/&gt;&lt;br/&gt;From your description, this should be working fine.&amp;nbsp; There should be no problem changing the Priority.&amp;nbsp;&amp;nbsp;&lt;br/&gt;&lt;br/&gt;There are two things I would suggest:&lt;br/&gt;&lt;br/&gt;1.&amp;nbsp; Do not use the 'Message' field, use the 'OriginalLogEntry' field.&amp;nbsp; The Message field is optional and will contain the result produced by the parser (if any).&amp;nbsp; The OriginalLogEntry is required and contains the full text of the log entry.&lt;br/&gt;&lt;br/&gt;2.&amp;nbsp; Have you tried debugging your plug-in?&amp;nbsp; The steps described in our documentation can be used to &lt;a href="https://www.logviewplus.com/docs/running_the_samples.html" id="if_insertedNode_1608209820948"&gt;launch LogViewPlus from within Visual Studio&lt;/a&gt;.&amp;nbsp; If you start LogViewPlus from a debugger, you should see your breakpoints being hit.&lt;br/&gt;&lt;br/&gt;Hope that helps.&amp;nbsp; Please let me know if you have any further questions or issues.&lt;br/&gt;&lt;br/&gt;Toby&lt;br/&gt;&lt;br/&gt;</description><pubDate>Thu, 17 Dec 2020 12:58:44 GMT</pubDate><dc:creator>LogViewPlus Support</dc:creator></item></channel></rss>