0

How to configure/disable logging

I have read the documentation and I thought I knew how to disable logging but it doesn't seem to be working. Following is my application.json file:

 [
    {
        "settings": [ "master" ],
        "appPort": 9001,
        "middleware": [ "./middleware/cookieParser.js", "./middleware/session.js", "./middleware/bodyParser.js", "./middleware/csrf.js", "./middleware/authentication.js", "./middleware/query.js", "./middleware/inputValidation.js", "./middleware/authorization.js" ],
        "database": "/tmp/master.db",
        "timeout": 600,
        "specs": {
            "login": {
                "type": "LoginMojit"
            },
            "app": {
                "type": "HTMLFrameMojit",
                "config": {
                    "deploy": true,
                    "child": {
                        "type": "AppMojit"
                    },
                    "assets": {
                        "top": {
                            "css": [
                                "http://yui.yahooapis.com/3.7.3/build/cssgrids/grids-min.css"
                            ]
                        }
                    }
                }
            },
            "widget": {
                "type": "WidgetMojit"
            },
            "backend": {
                "type": "BackendMojit"
            }
        },
        "yui": {
            "config": {
                "debug": false,
                "logLevel": "none"
            }
        }
    },
    {
        "settings": [ "environment:development" ],
        "staticHandling": {
            "forceUpdate": true
        }
    }
]

I believed the yui.config section should do the trick but when I run "mojit start" I still get all the WARN, DEBUG and INFO messages. What am I missing?

by
4 Replies
  • I think in order for logLevel to be interpreted you need to set debug:true. Yeah, seems counter-intuitive to set "debug" to get no logs :)

    2
  • The example that comes with the documentation sets debug to false. However it doesn't work with debug set to true either...

    0
  • I just updated to version 0.5.1 and everything seems to work fine. logLevel and friends must have been broken at some point in 0.4.x.

    0
  • @Daniel, yes, we reworked the whole yui and logger in 0.5.x to work the way YUI works. You should be fine with 0.5.x :)

    0

Recent Posts

in Yahoo! Mojito