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 18309 times
  1. Aaron Longnion

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

    Yes! Works great, Paul!
  2. User

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

    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

    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

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

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

    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

    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

    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 17:21

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

    #9 by Paul Klinkenberg - november 4, 2010 at 17:23

    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 17:32

    !Doh!
    Cheers
  11. Craig Kaminsky

    #11 by Craig Kaminsky - november 4, 2010 at 17:57

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

    Best,
    Craig
  12. david s

    #12 by david s - november 6, 2010 at 18:13

    "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 22:56

    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 13:36

    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 13:54

    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 15:19

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

    - Andrew.
  17. Paul Klinkenberg

    #17 by Paul Klinkenberg - december 2, 2010 at 0:09

    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

    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 - maart 16, 2011 at 23:39

    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 - maart 16, 2011 at 23:57

    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 13:41

    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 20:38

    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 19:12

    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 - maart 12, 2013 at 14:40

    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 - maart 12, 2013 at 14:57

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

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

    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 - juni 3, 2013 at 16:17

    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 - juni 3, 2013 at 16:49

    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 - juni 3, 2013 at 17:03

    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 - juni 3, 2013 at 21:33

    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 - juni 4, 2013 at 9:03

    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 - juni 4, 2013 at 23:47

    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 - juni 5, 2013 at 13:22

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

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

    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 - juni 27, 2014 at 9:55

    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 - januari 21, 2015 at 11:05

    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 - januari 21, 2015 at 13:39

    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 - maart 23, 2015 at 17:32

    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 - maart 23, 2015 at 19:59

    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 - maart 23, 2015 at 22:41

    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 - januari 29, 2016 at 19:28

    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 - februari 1, 2016 at 11:22

    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. Dan Gaspar

    #43 by Dan Gaspar - november 8, 2016 at 16:24

    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
  44. Paul Klinkenberg

    #44 by Paul Klinkenberg - november 9, 2016 at 12:22

    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
(will not be published)
Leave this field empty

community