Browse Source

This is a basic implementation of graylog that works.

mohammad
Mohammad Akbari 4 years ago
parent
commit
cd7ed35c75
Signed by: akbarjimi GPG Key ID: 55726AEFECE5E683
  1. 2
      .env.example
  2. 3
      composer.json
  3. 63
      config/logging.php
  4. 39
      docker-compose.yml
  5. 1990
      liwo.json

2
.env.example

@ -7,7 +7,7 @@ APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE="Asia/Tehran"
LOG_CHANNEL=stack
LOG_CHANNEL=gelf
LOG_LEVEL=debug
DB_CONNECTION=mysql

3
composer.json

@ -25,7 +25,8 @@
"spatie/image": "^1.0",
"spatie/laravel-medialibrary": "^9.0",
"spatie/laravel-query-builder": "^3.3",
"torann/geoip": "^3.0"
"torann/geoip": "^3.0",
"hedii/laravel-gelf-logger": "^6.0"
},
"require-dev": {
"facade/ignition": "^2.5",

63
config/logging.php

@ -40,5 +40,68 @@ return [
'level' => 'debug',
'days' => 14,
],
'gelf' => [
'driver' => 'custom',
'via' => \Hedii\LaravelGelfLogger\GelfLoggerFactory::class,
// This optional option determines the processors that should be
// pushed to the handler. This option is useful to modify a field
// in the log context (see NullStringProcessor), or to add extra
// data. Each processor must be a callable or an object with an
// __invoke method: see monolog documentation about processors.
// Default is an empty array.
'processors' => [
\Hedii\LaravelGelfLogger\Processors\NullStringProcessor::class,
// another processor...
],
// This optional option determines the minimum "level" a message
// must be in order to be logged by the channel. Default is 'debug'
'level' => 'debug',
// This optional option determines the channel name sent with the
// message in the 'facility' field. Default is equal to app.env
// configuration value
'name' => 'my-custom-name',
// This optional option determines the system name sent with the
// message in the 'source' field. When forgotten or set to null,
// the current hostname is used.
'system_name' => null,
// This optional option determines if you want the UDP, TCP or HTTP
// transport for the gelf log messages. Default is UDP
'transport' => 'udp',
// This optional option determines the host that will receive the
// gelf log messages. Default is 127.0.0.1
'host' => 'graylog',
// This optional option determines the port on which the gelf
// receiver host is listening. Default is 12201
'port' => 12201,
// This optional option determines the path used for the HTTP
// transport. When forgotten or set to null, default path '/gelf'
// is used.
'path' => null,
// This optional option determines the maximum length per message
// field. When forgotten or set to null, the default value of
// \Monolog\Formatter\GelfMessageFormatter::DEFAULT_MAX_LENGTH is
// used (currently this value is 32766)
'max_length' => null,
// This optional option determines the prefix for 'context' fields
// from the Monolog record. Default is null (no context prefix)
'context_prefix' => null,
// This optional option determines the prefix for 'extra' fields
// from the Monolog record. Default is null (no extra prefix)
'extra_prefix' => null,
],
],
];

39
docker-compose.yml

@ -21,7 +21,7 @@ services:
image: minio/minio
command: server /data
ports:
- 9000:9000
- 9005:9000
environment:
MINIO_ACCESS_KEY: root
MINIO_SECRET_KEY: minioroot
@ -109,9 +109,46 @@ services:
- 8025:8025 # web ui
networks:
- hi-user
mongo:
container_name: "mongo"
image: mongo:latest
networks:
- hi-user
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.2
environment:
- http.host=0.0.0.0
- transport.host=localhost
- network.host=0.0.0.0
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: 512
hard: 1024
networks:
- hi-user
graylog:
container_name: "graylog"
image: graylog/graylog:4.0.5
environment:
GRAYLOG_HTTP_EXTERNAL_URI: "http://127.0.0.1:9000/"
GRAYLOG_PASSWORD_SECRET: supersecretpassword
GRAYLOG_ROOT_PASSWORD_SHA2: "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"
GRAYLOG_ELASTICSEARCH_VERSION: 7
restart: always
depends_on:
- mongo
- elasticsearch
ports:
- 9000:9000
- 12201:12201
- 1514:1514
networks:
- hi-user
networks:
hi-user:
external: false
driver: bridge
hi:
external: true
volumes:

1990
liwo.json
File diff suppressed because it is too large
View File

Loading…
Cancel
Save