Logging Conversations

I plan to test this plugin but probably won’'t be able

to for several months as other projects take

priority.

Know the feeling

Jason.

I am almost done with a related project for my coursework here in graduate school. I have written an app that listens for message packets and writes them to an .xml file. I currently filter to only write MUC messages, but it could be modified. These files are then mirrored into a WEBDAV enabled native-xml database (using eXist). The files are then accessible for query via an xquery webapp.

This stuff has a lot of design tweaks that are specifically aimed at meeting the needs of my problem, but the basic principles of logging to an XML doc, importing into an XMLdb, and then web-enabled query access is working out pretty slick and isn’'t too tough to implement either.

I am having the same problem as ChiefofTheClass is having with the 0 dates. The date format in the log shows up as:

Mar 17, 2006 6:03:19 PM

Mar 18, 2006 12:00:40 AM

Hopefully this can be corrected quickly, I know your pressed for time but we use the chat for internal communication and a small HR issue has arisen in which we need a manager who isn’'t quite as ready to read raw logs.

Hi Traciatim,

well you know how it is. If one falls off a roof and can not fly it has only little time to learn flying *) **), if one falls in the water and can not swim it has only little time to learn swimming. So you have a manager which can not read raw logs, so it may teach itself very fast to read them unless one can provide a solution.

( Someone mentioned: “If you disappeared from the roof falling brake before you down land.” *)

( some lyrics: “The important thing is not the fall but the landing” **)

LG

Traciatim

May be, it will get the fix you want in WildFire 2.6.0 ? JM-298 Try voting there and please comment the date format you want there so that the developer can implement that too.

Regards,

wmhtet

As far as I understand it, JM-298 just allows raw log files to be rolled over based on date rather than size. This is a feature that I requested and removes the need to run the Perl script (see earlier in the thread) to split the log files into dated files.

This doesn’'t get around the date parsing problem.

What we have is a multitude of date formats. If the log viewer ran on the same platform that generates the logs, we would probably not have this problem as it would probably utilise the same date format as Wildfire.

However, the log viewer is currently restricted to Windows and .NET (Windows Forms and the Rich Edit control prevent compilation under Mono at this time).

There are several possible solutions to this problem:

  1. Having some sort of option to define the timestamp format when the logs are actually generated - This really isn’'t a fair solution as that just offloads the problem onto the Wildfire devs and they have got better things to do.

  2. Port the log viewer to Java so it can run on the same platform and automatically utilise the same sort of timestamp format - This was mooted some time ago, but I haven’'t got time at the moment to do a port (whilst learning Java in the process), however this is something I want to do.

2.5 Related to above - transform the viewer into a console plugin. The only problem I can think about that one is providing access to other people to the admin console to view the logs. It may not always be the tech guys that are reviewing these.

  1. Have an option in the current implementation of the Log Viewer to define the log timestamp format. Obviously this is the quickest solution, but how to implement it?

The Log Viewer user could probably define a regex in the config file that would be used during parsing, but that means the user needs to have some understanding of regular expressions. If some people balk at just looking at XML, maybe that isn’'t a good way to go.

Use standard dd/mm/yyyy type definitions in the config file - probably the best way and is probably what I will try and do.

I know that there are other things that need doing with this application, like fixing the filtering options, making sure group chats are rendered correctly and introducing indexing and exporting, but the date thing seems to be the most critical.

I know that I have left the project languishing for a while, but I will try and get new source and binary files posted as soon as I can.

Jason.

edit added clarification of restriction to .NET

another edit Has anyone had a go at hacking the source?

Message was edited by: jasonmcclean

I had the error with the root node jive also.

I was compiling the source. it turned out that if my exe was named anything other than log viewer.exe it errored.

I took a crack at the source code since my computer is logging the dates in the same format as described above…

<jive xmlns=“http://www.jivesoftware.org”><packet xmlns=“http://www.jivesoftware.org” streamID=“7915039” status=“auth” timestamp=“Aug 1, 2006 2:13:17 PM”>

I modified the code in XmppMsg.cs

I also configured my date time format in the config file to be yyyy/MM/dd HH:mm:ss because i like my dates and times to be chronologically sorted. i at first used a smal mm for the months, but that caused it to put the minutes in the month’'s spot. The capital MM works for months properly, my bad

The XmppMsg.cs section modified i will paste here. The RED code is what i put in/changed I have a binary that works for this. if anyone is interested email me and I’'ll send it to you.

evan.swendsen@champ-tech.com

public void SetTimeStamp(DateTime timeStamp)

{

_timeStamp = timeStamp;

}

public void SetTimeStamp(string dateTime)

{

//Msg time stamp in form of

//day month date time zone year

//e.g Mon Aug 29 08:04:44 GMT-03:00 2005

{color:#ff0000}dateTime = string.Format("",DateTime.Parse(dateTime));

Regex r = new Regex(@"(\w**?)\s(\w**?)\s(\d)\s(\d:\d:\d)\s\w{3,4}[0-9-:|0-9/-:]*?\s(\d)");

Match m = r.Match(dateTime);

if(m.Success)

{

_timeStamp = GetDateTime(m);

}

else

{

//this is what you get if, for some reason, the regex fails to extract the date and time

{color:#ff0000}//_timeStamp = DateTime.Parse(“01/Jan/1900 00:00:00”);

_timeStamp = DateTime.Parse(dateTime);
}

}

I am not good at per Regular expressions so i just formatted the string containing the date to match the format of the 01/Jan/1900 and forced it to pass my variable instead. If there is a better format that would be best. Please contact me if you have any questions or would like to help me with writing this section better.