美文网首页
morgan输出日志

morgan输出日志

作者: 简单coder | 来源:发表于2018-02-04 17:07 被阅读108次

    使用:var logger = require('morgan');

    // 定义日志和输出级别

    app.use(logger('dev'));

    dev

    Concise output colored by response status for development use. The:statustoken will be colored red for server error codes, yellow for client error codes, cyan for redirection codes, and uncolored for all other codes.

    :method :url :status :response-time ms - :res[content-length]

    short

    Shorter than default, also including response time.

    :remote-addr :remote-user :method :url HTTP/:http-version :status :res[content-length] - :response-time ms

    tiny

    The minimal output.

    :method :url :status :res[content-length] - :response-time ms

    相关文章

      网友评论

          本文标题:morgan输出日志

          本文链接:https://www.haomeiwen.com/subject/zkozwttx.html