Skip to content

Instantly share code, notes, and snippets.

@behroozam
Last active November 3, 2018 14:50
Show Gist options
  • Save behroozam/41763c1c95c5ab370f03fae9d4c46e88 to your computer and use it in GitHub Desktop.
Save behroozam/41763c1c95c5ab370f03fae9d4c46e88 to your computer and use it in GitHub Desktop.
send laravl log to stdout
APP_LOG_LEVEL=debug
LOG_CHANNEL=stderr
RUN ln -sf /dev/stderr /var/log/php7/error.log
input {
gelf {
port => 12201
type => gelf
}
}
filter {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{DATA:environment}\.%{LOGLEVEL:severity}: %{GREEDYDATA:message}" }
}
multiline {
pattern => "^\["
what => "previous"
negate => true
}
}
filter {
grok {
match => { "message" => "%{IPORHOST:remote_addr} - %{USERNAME:remote_user} \[%{HTTPDATE:time_local}\] \"%{DATA:request}\" %{INT:status} %{NUMBER:bytes_sent} \"%{DATA:http_referer}\" \"%{DATA:http_user_agent}\"" }
}
geoip {
source => "remote_addr"
}
}
output {
elasticsearch {
index => "log-%{+YYYY.MM.dd}"
hosts => "elasticsearch:9200"
}
[PHP]
short_open_tag = off
[Date]
date.timezone = "Asia/Tehran"
;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 200M;The maximum size of an uploaded file.
upload_max_filesize = 200M;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 200M
log_errors = On
error_log = /dev/stdout
memory_limit = 256M
expose_php = Off
opcache.memory_consumption=512
opcache.interned_strings_buffer=64
opcache.max_accelerated_files=32531
opcache.validate_timestamps=0
opcache.save_comments=1
opcache.fast_shutdown=0
php_admin_flag[log_errors] = on
php_flag[display_errors] = on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment