mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #343 from georgejhunt/log-location
sync from georgejhunt:log-location
This commit is contained in:
commit
58cea6f422
4 changed files with 24 additions and 9 deletions
|
@ -36,3 +36,15 @@
|
||||||
src: "{{ doc_root }}/common/fonts"
|
src: "{{ doc_root }}/common/fonts"
|
||||||
path: "{{ doc_root }}/common/webfonts"
|
path: "{{ doc_root }}/common/webfonts"
|
||||||
state: link
|
state: link
|
||||||
|
|
||||||
|
- name: Create log files which apache and nginx can write
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
mode: 0770
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- /var/log/apache2
|
||||||
|
- "{{ nginx_log_dir }}"
|
||||||
|
|
||||||
|
|
|
@ -46,9 +46,9 @@ if len(sys.argv) > 1:
|
||||||
loggingLevel = "DEBUG"
|
loggingLevel = "DEBUG"
|
||||||
|
|
||||||
# set up some logging -- selectable for diagnostics
|
# set up some logging -- selectable for diagnostics
|
||||||
logging.basicConfig(filename='/var/log/apache2/portal.log',format='%(asctime)s.%(msecs)03d:%(name)s:%(message)s', datefmt='%M:%S',level=loggingLevel)
|
logging.basicConfig(filename='/var/log/nginx/portal.log',format='%(asctime)s.%(msecs)03d:%(name)s:%(message)s', datefmt='%M:%S',level=loggingLevel)
|
||||||
logger = logging.getLogger('/var/log/apache2/portal.log')
|
logger = logging.getLogger('/var/log/nginx/portal.log')
|
||||||
handler = RotatingFileHandler("/var/log/apache2/portal.log", maxBytes=100000, backupCount=2)
|
handler = RotatingFileHandler("/var/log/nginx/portal.log", maxBytes=100000, backupCount=2)
|
||||||
logger.addHandler(handler)
|
logger.addHandler(handler)
|
||||||
|
|
||||||
PORT={{ captiveportal_port }}
|
PORT={{ captiveportal_port }}
|
||||||
|
|
|
@ -42,9 +42,16 @@ http {
|
||||||
# Logging Settings
|
# Logging Settings
|
||||||
##
|
##
|
||||||
|
|
||||||
access_log {{ apache_log_dir }}/access.log;
|
log_format awstats
|
||||||
error_log {{ apache_log_dir }}/error.log;
|
'$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log {{ nginx_log_dir }}/access.log awstats;
|
||||||
|
error_log {{ nginx_log_dir }}/error.log;
|
||||||
|
|
||||||
log_format scripts '$request > $document_root$fastcgi_script_name $fastcgi_path_info';
|
log_format scripts '$request > $document_root$fastcgi_script_name $fastcgi_path_info';
|
||||||
|
access_log {{ nginx_log_dir }}/scripts.log scripts;
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
@ -3,10 +3,6 @@ server {
|
||||||
server_name {{ iiab_hostname }};
|
server_name {{ iiab_hostname }};
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
access_log {{ apache_log_dir }}/access.log;
|
|
||||||
error_log {{ apache_log_dir }}/error.log;
|
|
||||||
access_log {{ apache_log_dir }}/scripts.log scripts;
|
|
||||||
|
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
# let individual services drop location blocks in conf.d
|
# let individual services drop location blocks in conf.d
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue