1. #21
    Touch Premium Member
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
    theschafergroup is on a distinguished road

      0  

    Default


    Pedro,

    Do you think the logger would easily be able to log instead to the localStorage rather than the console?
    Perhaps then the viewer portion could have a listener to localStorage changes and refreshing it’s store?
    This way a second debug browser tab would be able to persist the log across page loads.
    Perhaps a controller object could watch and prune the localStorage to ‘occurrence’ and ‘duration’ limit settings per category?

    Is this close to where your headed with the code?
    Does is sound viable?
    Thoughts?

  2. #22
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      1  

    Default


    Quote Originally Posted by theschafergroup View Post
    Pedro,

    Do you think the logger would easily be able to log instead to the localStorage rather than the console?
    Perhaps then the viewer portion could have a listener to localStorage changes and refreshing it’s store?
    This way a second debug browser tab would be able to persist the log across page loads.
    Perhaps a controller object could watch and prune the localStorage to ‘occurrence’ and ‘duration’ limit settings per category?

    Is this close to where your headed with the code?
    Does is sound viable?
    Thoughts?
    Writing logs to local storage should be relatively easy to do, as log4js-ext is architected with this kind of extension in mind. You need to write your own appender, deriving it from AppenderBase, and register it the same way you register other appenders (think of the standard LogViewerAppender).

    Appenders are in charge of sending log messages to the final destination, be it the browser console, the built-in viewer, a remote server or local storage. You will be able to write your own appender by taking a look at the ExtLogAppender and LogViewerAppender implementations.

    ...

    Viewing data stored in the local storage in the built in viewer will be a different business, as you will be handling old stored logs, not logs as they are created, which is what the viewer is written for.

    Anyway, as an idea, you might get what you want by a) creating an appender inheriting from LogViewerAppender that writes logs both to the built-in viewer and the local storage. Then, b), you should create your own viewer inheriting from LogViewerWindow: whenever an instance is created, it will load old logs in the local storage, giving the appearance that the view has not been destroyed across pages, and new logs will be written both to the local storage and the viewer...

    Connect you new appender and viewer, and voila, you should be able to use them the way you use the built-in viewer and appender.

    Just a quick idea, other approaches will work too... But it looks relatively easy to do, as most functionality is already there, so you might want to give it a try.

    ...

    BTW, handling logs across pages seems a useful use case for some users (not for my typical scenario, though), and I will consider adding it at some later moment -no promise, though, and in any case it can't be before I implemented remote server logging, which I hope I will provide in September/October.

    Regards,
    Pedro Agulló, Barcelona (Spain)
    Agile team building, consulting, training & development
    DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/

  3. #23
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    372
    Vote Rating
    5
    ttbgwt is on a distinguished road

      0  

    Default


    Excellent library! Is it possible to add another column called 'Elapsed' to the right of the 'Time' column that would display the time difference between when the current log event occurred and the previous log event occurred? This would be very helpful. Thanks!

  4. #24
    Sencha Premium Member
    Join Date
    Oct 2008
    Posts
    40
    Vote Rating
    10
    lombardo will become famous soon enough

      0  

    Default


    Excellent library............

    I only have one suggestion.............it could be possible to add a level config to the AppenderBase class.....
    that´s way we can log message at specific level according the appender

  5. #25
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default log4js-ext 2.0 is out

    log4js-ext 2.0 is out


    I have finished version 2.0 of log4js-ext!

    The main new features in 2.0 are:
    • Remote logging support: now you can send logs to a remote web app, and get them logged against Log4js, Slf4j and Apache Commons Logging.
    • Enhanced built-in log viewer with search & highlight capabilities.
    You can see the search & highlight feature in action in the image below.

    search-and-highlight.png

    For more info, click here.

    You can get it at https://code.google.com/p/log4js-ext

    Enjoy!
    Pedro Agulló, Barcelona (Spain)
    Agile team building, consulting, training & development
    DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/

  6. #26
    Touch Premium Member
    Join Date
    Nov 2011
    Posts
    124
    Vote Rating
    0
    JavascriptParrot is on a distinguished road

      0  

    Default


    Do you have a version for Sencha Touch?