Results 1 to 2 of 2

Thread: Limit maximum number of javascript log messages for a page in MVC

Hybrid View

  1. #1
    Join Date
    Mar 2013

    Limit maximum number of javascript log messages for a page in MVC

    Hi Folks,

    I am newbie to Javascript.Our team has implement Client side Javascript logging which will log info,warning,errors and send to server..Mainly i am working on a feature where we can have a variable setting "MaxLogMessages" in Javascript logging framework.Lets say it is set to 25.

    Then max of "25" logging message can be posted for a single page so to prevent applications from flooding out the logging service.

    Need your suggestion what is the best way to implement this feature in logging framework


  2. #2
    Join Date
    Jul 2008
    urbana, il
    one way is to monkey patch the console methods:

      var maxMessages=25;
       var orig=console[k] || console.log ;
           if( maxMessages-- ){ return orig.apply(this, arguments); }
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center