Railo admin plugin: Log analyzer version 2.1.0

When I told Gert Franz from Railo that it was a pity that there was no log viewing option in the Railo admin, he smiled and showed me a log analyzer plugin which he already wrote. "But it's still in development, so we haven't published it yet", he said.

The plugin indeed lacked some options, but not anymore! I added the remaining options, and now made it available to everyone via my extensionProvider.
It shows you the logs from the web admin, ordered by error message, last occurence date, or amount of occurences. And you can off course download the log file.

Installation for one website, or the server context (new!)

Go to your Web or Server admin, click on Extension > Providers, and add the following url:

http://www.railodeveloper.com/ExtensionProvider.cfc

Then, go to Extension > Applications, and install the Log analyzer (web version) or the Log analyzer (global server version) (server version)

Last, you have to logout and login to the admin again, to see the new plugin in the navigation.

Enjoy!

Installer for multiple websites

Someone asked on the mailing list why the plugin could not be installed from within the server admin. For my own servers, that would also be a great option. One installer to rule them all!

So what you now can do, is add the extension provider to the SERVER admin, and then install the Log analyzer installer plugin. This plugin can then install and uninstall the plugin to any web context (website) you want.

Enjoy*2!

Change log

Version 2.1, 1 december 2010: added the server Log analyzer plugin. Fixed a bug which occured if the log had an empty error message. Changed some security issues related to allowed paths.

Version 1.1.3, 4-11-2010: fixed a major bug in version 1.1.2: for some reason I can't use private functions in the plugin :-/

Version 1.1.2, 4-11-2010: fixed a bug: the last error of any parsed template was not used/shown.

Version 1.1.1, 4-11-2010:
- fixed error when trying to change the 'rows per page' select box on windows
- improved file parsing: sometimes new errors were skipped or appended to the previous error "detail output"
- html formatting in the error message and detail is now escaped with htmlEditFormat()
- chart on the detail page now hopefully only shows integers
- chart is only shown if there is more then one occurence date
- chart x-axis is now sorted correctly on date
- long text without spaces in error detail is now broken into pieces, to prevent the table from running off-screen.

del.icio.us Digg StumbleUpon Facebook Technorati Fav reddit Google Bookmarks
| Viewed 2505 times
  1. Aaron Longnion

    #1 by Aaron Longnion - November 4, 2010 at 4:44 AM

    Yes! Works great, Paul!
  2. User

    #2 by User - November 4, 2010 at 5:51 AM

    key [LOCK_TIMEOUT] doesn't exist in struct (keys:)
    My installation failed:

    error occured in Install.cfc:11
    9: <cfargument name="step" type="numeric">
    10:
    11: <cfif len(config.mixed.lock_timeout) and not IsNumeric(config.mixed.lock_timeout)>
    12: <cfset error.fields.lock_timeout="lock timeout must be a positive numeric value greather or equal to 0">
    13: </cfif>
  3. User

    #3 by User - November 4, 2010 at 5:53 AM

    Lets try this again. It lost the brackets as html.

    key [LOCK_TIMEOUT] doesn't exist in struct (keys:)

    error occured in Install.cfc:11
    9: &lt;cfargument name="step" type="numeric"&gt;
    10:
    11: &lt;cfif len(config.mixed.lock_timeout) and not IsNumeric(config.mixed.lock_timeout)&gt;
    12: &lt;cfset error.fields.lock_timeout="lock timeout must be a positive numeric value greather or equal to 0"&gt;
    13: &lt;/cfif&gt;
  4. AJ Mercer

    #4 by AJ Mercer - November 4, 2010 at 10:24 AM

    Just installed - very nice indeed. Thank you.
  5. Paul Klinkenberg

    #5 by Paul Klinkenberg - November 4, 2010 at 10:49 AM

    Hi "User", on what version of Railo are you? I have not seen that error before. I think that if you update your Railo install, everything will work fine. (The value which is giving an error, does not exist in the code I wrote, so it must be a Railo thing)
  6. Donal Mulcahy

    #6 by Donal Mulcahy - November 4, 2010 at 11:07 AM

    Getting error with installing plug-in I have latest version of railo

    Invalid arguments count for operation GETDOWNLOADDETAILS (5 instead of 4)
  7. Paul Klinkenberg

    #7 by Paul Klinkenberg - November 4, 2010 at 12:14 PM

    Hi Donal, that is quite an interesting error you are having. Could you do me a favor, and tell me what exact version number of Railo you are using? You can find it on the start page of your Railo web admin (or click on the Railo logo in the web admin to go to that start page)
    Also, I think I "fixed" the problem you were having, so you can try it again! But please post the version number; it is important to me to be able to debug this issue.
    Kind regards, Paul
  8. TOm K

    #8 by TOm K - November 4, 2010 at 5:21 PM

    I can only see Webserver2Tomcat vhost copier as an application?
  9. Paul Klinkenberg

    #9 by Paul Klinkenberg - November 4, 2010 at 5:23 PM

    Hi Tom, you should go to your WEB admin, not the server admin. (you're not the only one making this mistake btw)
  10. TOm K

    #10 by TOm K - November 4, 2010 at 5:32 PM

    !Doh!
    Cheers
  11. Craig Kaminsky

    #11 by Craig Kaminsky - November 4, 2010 at 5:57 PM

    Absolutely wonderful extension! Thank you, very much, Paul.

    Best,
    Craig
  12. david s

    #12 by david s - November 6, 2010 at 6:13 PM

    "Cannot run program "chmod": java.io.IOException: error=12, Cannot allocate memory"

    Haven't looked at your source but i'm assuming you running cfexecute to do this. My setup is on a linux 64bit environment.

    http://stackoverflow.com/questions/1124771/how-to-solve-java-io-ioexception-error12-cannot-allocate-memory-calling-runt
  13. Paul Klinkenberg

    #13 by Paul Klinkenberg - November 6, 2010 at 10:56 PM

    Hi David, the error is not coming directly from my code; I'm not doing any chmod or cfexecute. It most likely has to do with too little memory available for Railo in your install. You can find a lot of resources online on how to change these memory settings for Railo on tomcat/resin/jetty. By default, they are set pretty low. Good luck, and thanks for the notice anyway! Paul
  14. Andrew Clarke

    #14 by Andrew Clarke - November 11, 2010 at 1:36 PM

    Hi Paul. Thanks for getting this plugin out.
    This is the first time I've tried to use a Railo extension but I'm running into a problem. I added http://www.railodeveloper.com/ExtensionProvider.cfc as an extension, but when I then go to applications, I get the following error: "can't load provider [http://www.railodeveloper.com/ExtensionProvider.cfc]". I then tried to verify your provider, and got the following alt/title tags describing the error: alt="Server returned HTTP response code: 403 for URL: http://www.railodeveloper.com/ExtensionProvider.cfc?wsdl "
    This is on Railo 3.1.2.001 on Mac OS X. Any ideas? Thanks, - Andrew.
  15. Paul Klinkenberg

    #15 by Paul Klinkenberg - November 11, 2010 at 1:54 PM

    Hi Andrew, thanks for notifying me about this! I fixed it now, and it should now work as expected.
    Yesterday, my server got 1.000's of requests from a few ip addresses that were all using the useragent "Java/1.6.0_xx". That's the default user-agent when you call a url from java. Therefor, I locked my server down to stop every request with such a useragent. But guess what? Railo also uses this useragent while retrieving extensionprovider data :-/
    Anyway, it's fixed now!
  16. Andrew Clarke

    #16 by Andrew Clarke - November 11, 2010 at 3:19 PM

    Thanks Paul. That did the trick and I have it installed now.

    - Andrew.
  17. Paul Klinkenberg

    #17 by Paul Klinkenberg - December 2, 2010 at 12:09 AM

    Hi all, I just released version 2.1 of the plugin! Changes: "added a server Log analyzer plugin. Fixed a bug which occured if the log had an empty error message. Changed some security issues related to allowed paths."
  18. Tjarko

    #18 by Tjarko - December 9, 2010 at 10:23 AM

    Great plugin, it should be standard in Railo. :-) could use some improvements with a search but it's very good.
  19. William Dale

    #19 by William Dale - March 16, 2011 at 11:39 PM

    Can you add the full url to the log detail data.
    Current Headings are as follow: Message, Last occurence, Thread name, Type, Occurences, and Detail.
    Could you add url.
    I use a query string to support mvc design pattern. So everything goes through index.cfm
    Adding full url will help find templates to debug.
    Great Work!
    -- Bill Dale
  20. Paul Klinkenberg

    #20 by Paul Klinkenberg - March 16, 2011 at 11:57 PM

    Hi William / Bill,
    The information shown with this plugin, is all the information which is available in the log files. So unfortunately, the requested URL is not saved to the log file at the moment of error.
    I do think it is an interesting suggestion. What you could do, is make a "feature request" for this in the Railo bug tracking system at https://issues.jboss.org/secure/CreateIssue.jspa?pid=12310683&issuetype=2
    If you make it really clear that it would be awesome to have the requested url inside the Detail section of the exception.log file, then you've got a (small) chance that the Railo developers might be so cool to put it in ;-)

    What will probably help you more, is to add the tag [cferror] in your Application.cfm, which sends you all error data by email. See Ben's blog post about this: http://www.bennadel.com/blog/932-Ask-Ben-Handling-Errors-With-ColdFusion-CFError.htm

    Good luck, Paul
  21. Sebastiaan

    #21 by Sebastiaan - September 22, 2011 at 1:41 PM

    Hi Paul,
    Thanx, this works! Would've been nice if it showed up somewhere at the top of the Railo Server Menu, but now I know where it is ;-) Gonna play some with it. Nice addition to the error handling we've built into all sites and apps (sends mail with full error and dumps when something goes awry).
  22. Paul Klinkenberg

    #22 by Paul Klinkenberg - September 22, 2011 at 8:38 PM

    Hi Sebastiaan, the ability to place menu items in the admin on places other than the Plugins section, is very new. Don't know if it is already released even. But, if I have time, I will move it to the Debugging section of the menu.
    Cheers, Paul
(will not be published)
Leave this field empty: