Giter Site home page Giter Site logo

rekgrpth / ngx_http_datetime_variable_module Goto Github PK

View Code? Open in Web Editor NEW

This project forked from comdeng/ngx_http_datetime_variable_module

1.0 2.0 0.0 5 KB

It does enhance nginx too add variable year, month, day, hour, minute, second

Makefile 0.88% C 91.62% Perl 7.50%

ngx_http_datetime_variable_module's Introduction

ngx_http_datetime_variable_module

For support nginx rotating log, these are some ways to solve this as the following:

  1. Using logrotate
  2. Using access_log pipe patched by tengine

But I'm more prefer to using variable in access_log for nginx just like this as the following:

http {
  access_log logs/access-%YY-%MM-%DD-%HH-%mm-%ss.log
}

In nginx internals, there are no such variable like %YY, So i adding the variable by nginx module for nginx as the following:

  1. $datetime_year: [1970-xxxx]
  2. $datetime_month: [00-12]
  3. $datetime_day: [0-31]
  4. $datetime_hour: [0-23]
  5. $datetime_minute: [0-59]
  6. $datetime_second: [0-59]
  7. $datetime_lyear: localtime for datetime_year
  8. $datetime_lmonth: localtime for datetime_month
  9. $datetime_lday: localtime for datetime_day
  10. $datime_lhour: localtime for datetime_hour
  11. $datetime_lminute: localtime for datetime_minute
  12. $datetime_lsecond: localtime for datetime_second

ngx_http_datetime_variable_module's People

Contributors

detailyang avatar

Stargazers

Georgy Shelkovy avatar

Watchers

James Cloos avatar Georgy Shelkovy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.