Railo admin plugin: Log analyzer version 2.2.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.2, 4 june 2013: Added View option, to view the log file inline in the admin. Also fixed a bug with Railo 4.0.x: cfdirectory filter attribute doesn't allow pipe character as delimiter anymore. Also updated the styling, so tables look normal again.

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 30034 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
  23. mike fransblow

    #23 by mike fransblow - September 27, 2012 at 7:12 PM

    Just installed the plug-in, looks great. I did have to update overview.cfm lines 79-91. We have strict variable scoping turned on for our railo installs, and the query loop isn't scoped . Simple fix, I can provide the patch if nec.

    cheers, Mike F
  24. Dan

    #24 by Dan - March 12, 2013 at 2:40 PM

    Under Railo 4.0.3.006 final I get
    invalid component definition, can't find railo_plugin_directory.LogAnalyzerInstaller.Action
  25. Paul Klinkenberg

    #25 by Paul Klinkenberg - March 12, 2013 at 2:57 PM

    Hi Dan, you probably need to logout of the admin, and login again.
    Cheers, Paul
  26. Michael

    #26 by Michael - June 3, 2013 at 10:14 AM

    Hi Paul,
    I'm using RAILO 4.1.0.010 beta and no logs are shown in the web administrator.
    (Windows 2003 (5.2) 32bit, Servlet Container Resin/3.1.9).
    I've restartet the server, but it seems, that the log analyzer couldn't find any logs.
    What could be wrong? Can you give me a hint, where to search?

    Thank you for your help

    Michael
  27. Paul

    #27 by Paul - June 3, 2013 at 4:17 PM

    Hi Michael,

    Can you check if there are any log files in (web root)/WEB-INF/railo/logs/
    Do you get an error in the admin, or is it just an empty list?
    Paul
  28. Michael

    #28 by Michael - June 3, 2013 at 4:49 PM

    Hi Paul,
    yes, there are entrys, but they are all to old (date between 2013/03/19 and 2013/06/02).
    Is it possible to disable logging? Maybe I've done this ;-)

    Michael
  29. Michael

    #29 by Michael - June 3, 2013 at 5:03 PM

    Additional info:
    I deleted all log-files and railo created new ones.
    Then I created an error-message in my program and railo logged it in application.log and exception.log. But the log analyzer didn't show it.
    Thank you for your help
    Michael
  30. Paul Klinkenberg

    #30 by Paul Klinkenberg - June 3, 2013 at 9:33 PM

    Hi Michael, for now I would assume it is a rights issue. Could you try to run the following code in the web context where the log analyzer is used in:
    <cfset logsPath = expandpath('/WEB-INF/railo/logs/')/>
    <cfdump var="#directorylist(logsPath)#"/>
    <cfset fileWrite(logsPath & "testfile.txt", "hi there") />
    <cfdump var="#fileRead(logspath & 'testfile.txt')#" />
    <cfset fileDelete(logsPath & "testfile.txt") />

    If all goes well, you don't get an error on-screen, and the first dump will show you a file listing as an array.
    Does that work? On what OS are you running Railo?
    Cheers, Paul
  31. Michael

    #31 by Michael - June 4, 2013 at 9:03 AM

    Hi Paul,
    that works very fine:
    Array
    1   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\application.log
    2   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\deploy.log
    3   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\exception.log
    4   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\gateway.log
    5   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\mail.log
    6   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\orm.log
    7   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\requesttimeout.log
    8   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\rest.log
    9   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\scheduler.log
    10   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\scope.log
    11   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\thread.log
    12   string   D:\Inetpub\wwwroot\WEB-INF\railo\logs\trace.log
    string   hi there

    Railo runs under Windows Server 2003 (5.2) 32bit, Servlet Container Resin/3.1.9
    Looks like I haven't disabled anything, which I shouldn't.

    Thanks again for your help

    Michael
  32. Paul Klinkenberg

    #32 by Paul Klinkenberg - June 4, 2013 at 11:47 PM

    Hi Michael,
    There is a new version out, which solves this problem :)
    Just go to your Railo admin > Extensions > Applications, and update the Log analyzer.
    Cheers, Paul
  33. Michael

    #33 by Michael - June 5, 2013 at 1:22 PM

    Hi Paul,
    thank you for your help. Now it works!!!
    Cheers, Michael
  34. AJ Mercer

    #34 by AJ Mercer - June 27, 2014 at 8:48 AM

    Hi Paul

    getting this on railo 4.2

    Attribute [codename] for tag [admin] is required if attribute action has the value [UpdateExtensions]

    error occured in /railo-context-compiled/admin/extension.applications.install2.cfm:157
    called by /railo-context-compiled/admin/extension.applications.cfm:83
    called by /railo-context-compiled/admin/web.cfm:377
    called by /railo-context-compiled/admin/server.cfm:2
  35. Paul Klinkenberg

    #35 by Paul Klinkenberg - June 27, 2014 at 9:55 AM

    Hi AJ,
    I tried to reproduce this on Railo 4.2.1.000 and 4.2.1.002, but alas, it worked ;-)
    I see in your msg that you're calling "/railo-context-compiled/", that's not a regular install, or is it? If not, please point me out which codebase/branch you are using.
    The error itself seems to be a problem with the Railo admin, not the extension. Or, well, the extension's config.xml has an empty string for the "codename", which used to work, and is kind-of-documented as not required. Something seems to have changed in your codebase, where a value suddenly is required...
    If you would, just email me, to keep this comments list clean :) Cheers, Paul
  36. Martl

    #36 by Martl - January 21, 2015 at 11:05 AM

    just tried to install and use the LogAnalyzerPlugin and got this error message:

    Railo 4.2.1.008 Error (expression)
    Message   invalid component definition, can't find component [railo_plugin_directory.LogAnalyzerInstaller.Action]
    Stacktrace   The Error Occurred in
    /railo-context-compiled/admin/plugin.cfm: line 15
    called from /railo-context-compiled/admin/web.cfm: line 389
    called from /railo-context-compiled/admin/server.cfm: line 2
    Java Stacktrace   invalid component definition, can't find component [railo_plugin_directory.LogAnalyzerInstaller.Action]
    ...

    don't know if i missed something or its a bug.

    thanks for help.
  37. Paul Klinkenberg

    #37 by Paul Klinkenberg - January 21, 2015 at 1:39 PM

    Hi Martl, first off sorry for not approving your comment earlier. It got lost somewhere :/
    The problem you mentioned should be fixable by restarting Railo, either from within the server admin, or Tomcat itself.
    If that doesn't help, let me know!
    Cheers, Paul
  38. Michael

    #38 by Michael - March 23, 2015 at 5:32 PM

    Hi Paul,
    do you plan to support lucee with your Log analyzer?
    I like your tool very much and I'm missing it under lucee.

    Cheers, Michael
  39. Paul Klinkenberg

    #39 by Paul Klinkenberg - March 23, 2015 at 7:59 PM

    Hi Michael, yes, for sure I will. I actually thought it already worked, but thanks for letting me know. I will add another comment when it is available in the Lucee store.
    Cheers, Paul
  40. Paul Klinkenberg

    #40 by Paul Klinkenberg - March 23, 2015 at 10:41 PM

    Hi all, there is a new version out, working on Lucee. You can download it from here:
    https://github.com/paulklinkenberg/lucee-loganalyzer/blob/master/dist/classic/extension.zip?raw=true
    After download, go to your lucee admin > Extension > Applications, and use the Upload new extension form.
    It will soon be available in the Lucee Applications list as well.
  41. George Murphy

    #41 by George Murphy - January 29, 2016 at 7:28 PM

    Hi Paul,

    I was able to install this from GitHub. However got this error after clicking the plugins > log analyzer link.
    invalid component definition, can't find component [lucee_plugin_directory.Log analyzer.Action]
    Stacktrace   The Error Occurred in
    /context/admin/plugin.cfm: line 14
    called from /context/admin/web.cfm: line 389
    called from /context/admin/server.cfm: line 2
    Java Stacktrace   invalid component definition, can't find component [lucee_plugin_directory.Log analyzer.Action]
  42. Paul Klinkenberg

    #42 by Paul Klinkenberg - February 1, 2016 at 11:22 AM

    Hi George, the error you encountered has to do with caching in the Lucee admin. After a tomcat/server restart, or a restart via Server admin > Restart, the plugin should be usable.
    It is something I still want to look into at some point, but never gotten around to do yet.
    Kind regards, Paul Klinkenberg
  43. Dale Marinello

    #43 by Dale Marinello - May 24, 2016 at 5:35 PM

    When I try to install the extension I get the following error:

    file or directory zip://C:/inetpub/wwwroot/WEB-INF/lucee/extensions/843A842C8056372CB80CD57830B66DBE/2.1.2.rep!/config.xml not exist.

    Dale
  44. Jay Bigam

    #44 by Jay Bigam - July 7, 2016 at 5:23 PM

    Hey Paul, I've tried installing extension-loganalyzerinstaller-2.2.1.35.lex in L5.0.0.252 and I'm getting a deploy error

    "The Extension [C:\lucee\tomcat\lucee-server\deploy\extension-loganalyzerinstaller-2.2.1.35.lex] is invalid,no Manifest file was found at [META-INF/MANIFEST.MF]."

    I've really come to rely on this plugin and would love to get it installed in my new 5 instance.

    Any ideas?
  45. Dan Gaspar

    #45 by Dan Gaspar - November 8, 2016 at 4:24 PM

    Hi Paul,
    Is this extension still supported?
    When I try to upload the zip file from github in the Lucee Admin under "Upload New Extension" I get the error "The file could not be uploaded. The error:
    Only .lex is allowed as extension! "
    I'm using Lucee 5.1.0.34

    Thanks
  46. Paul Klinkenberg

    #46 by Paul Klinkenberg - November 9, 2016 at 12:22 PM

    Hi Dan, and other Lucee 5.1 users,
    You can install the plugin by uploading this file in the admin: https://github.com/paulklinkenberg/lucee-loganalyzer/blob/master/dist/modern/extension-loganalyzer-2.3.1.15.lex?raw=true
    After upload, you might need to wait half a minute or so, and then either reload Lucee, or append "?alwaysnew=1" to the admin url (/lucee/admin/web.cfm?alwaysnew=1)

    Kind regards, Paul Klinkenberg
  47. Dan Gaspar

    #47 by Dan Gaspar - January 22, 2018 at 8:20 PM

    Thanks again Paul!
(will not be published)
Leave this field empty