Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No access log ? #34

Closed
binnn6 opened this issue Sep 13, 2017 · 6 comments
Closed

No access log ? #34

binnn6 opened this issue Sep 13, 2017 · 6 comments
Labels
z-enhancement ⬆️ Product Enhancement

Comments

@binnn6
Copy link

binnn6 commented Sep 13, 2017

There is no access log in unit ? Or it's desiged to have no access log ?

@VBart VBart added the z-enhancement ⬆️ Product Enhancement label Sep 14, 2017
@VBart
Copy link
Contributor

VBart commented Sep 14, 2017

There are no access logs at the moment. You can utilize nginx for logging requests.
This feature is planned. As for now we'd like to collect any ideas and requirements, so please feel free to share.

@binnn6
Copy link
Author

binnn6 commented May 9, 2018

In change log, i find basic access logging is supported by now, but can't find any configure example anywhere. I don't know how to use it.

@davide-romanini
Copy link

@binnnliu Just add a root element access_log pointing to a file, eg:

{
  "listeners": {
    "*:8300": {
      "application": "default"
    }
  },
  "applications": {
    "default": {
      "type": "php",
      "processes": 10,
      "root": "/app/public",
      "index": "index.php",
      "script": "index.php"
    }
  },
  "access_log": "/proc/self/fd/1"
}

It will generate something like:
192.168.99.1 - - [15/May/2018:14:19:58 +0000] "GET /foo HTTP/1.1" 200 65 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36"

@binnn6
Copy link
Author

binnn6 commented May 18, 2018

Got it. Thanks. @davide-romanini

@BrainGithub
Copy link

unit is funy

@VBart
Copy link
Contributor

VBart commented Jun 7, 2018

Initial support for access logging has been added in 204c394 and released with Unit 1.0.

@VBart VBart closed this as completed Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
z-enhancement ⬆️ Product Enhancement
Projects
None yet
Development

No branches or pull requests

4 participants