Skip to content

Commit 56ce706

Browse files
author
DKravtsov
committed
easy-log-bundle (old name easy-log-handler) alive
0 parents  commit 56ce706

26 files changed

+3486
-0
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/.git*
2+
/.github
3+
/.idea*
4+
.dockerignore
5+
.editorconfig
6+
.gitignore
7+
8+
/vendor/
9+
10+
Dockerfile
11+
docker-compose.yml

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_size = 2
16+
17+
[{composer.json,Makefile}]
18+
indent_style = tab

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore
6+
composer.lock binary
7+
symfony.lock binary

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: easy-log-bundle
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v1
23+
- name: Build the docker images
24+
run: make build
25+
- name: Start the docker images
26+
run: make start
27+
- name: Check running containers
28+
run: docker ps -a
29+
- name: Test bundle with Symfony 4
30+
run: make test-using-symfony-4
31+
- name: Display information
32+
run: make info
33+
- name: Test bundle with Symfony 5
34+
run: make test-using-symfony-5
35+
- name: Display information
36+
run: make info
37+
- name: Stop the docker images
38+
run: make stop

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.idea
2+
/docker/src/
3+
/composer.lock
4+
/vendor/

Dockerfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
FROM php:7.4-fpm
2+
3+
# set main params
4+
ARG BUILD_ARGUMENT_DEBUG_ENABLED=false
5+
ENV DEBUG_ENABLED=$BUILD_ARGUMENT_DEBUG_ENABLED
6+
ARG BUILD_ARGUMENT_ENV=dev
7+
ENV ENV=$BUILD_ARGUMENT_ENV
8+
ENV APP_HOME /var/www/html
9+
10+
# check environment
11+
RUN if [ "$BUILD_ARGUMENT_ENV" = "default" ]; then echo "Set BUILD_ARGUMENT_ENV in docker build-args like --build-arg BUILD_ARGUMENT_ENV=dev" && exit 2; \
12+
elif [ "$BUILD_ARGUMENT_ENV" = "dev" ]; then echo "Building development environment."; \
13+
else echo "Set correct BUILD_ARGUMENT_ENV in docker build-args like --build-arg BUILD_ARGUMENT_ENV=dev. Available choices are dev." && exit 2; \
14+
fi
15+
16+
# install all the dependencies and enable PHP modules
17+
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
18+
procps \
19+
nano \
20+
git \
21+
unzip \
22+
libicu-dev \
23+
zlib1g-dev \
24+
libxml2 \
25+
libxml2-dev \
26+
libreadline-dev \
27+
libzip-dev \
28+
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
29+
&& docker-php-ext-configure intl \
30+
&& docker-php-ext-install \
31+
pdo_mysql \
32+
sockets \
33+
intl \
34+
opcache \
35+
zip \
36+
&& rm -rf /tmp/* \
37+
&& rm -rf /var/list/apt/* \
38+
&& rm -rf /var/lib/apt/lists/* \
39+
&& apt-get clean
40+
41+
# create document root
42+
RUN mkdir -p $APP_HOME/public
43+
44+
# change owner
45+
RUN chown -R www-data:www-data $APP_HOME
46+
47+
# put php config for Symfony
48+
COPY ./docker/$BUILD_ARGUMENT_ENV/www.conf /usr/local/etc/php-fpm.d/www.conf
49+
COPY ./docker/$BUILD_ARGUMENT_ENV/php.ini /usr/local/etc/php/php.ini
50+
51+
# install Xdebug in case dev/test environment
52+
COPY ./docker/general/do_we_need_xdebug.sh /tmp/
53+
COPY ./docker/dev/xdebug.ini /tmp/
54+
RUN chmod u+x /tmp/do_we_need_xdebug.sh && /tmp/do_we_need_xdebug.sh
55+
56+
# copy modified monolog config for testing easyLogBundle
57+
COPY ./docker/dev/monolog.yaml /tmp/
58+
59+
# install composer
60+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
61+
RUN chmod +x /usr/bin/composer
62+
ENV COMPOSER_ALLOW_SUPERUSER 1
63+
64+
# set working directory
65+
WORKDIR $APP_HOME
66+
67+
# create composer folder for user www-data
68+
RUN mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www/.composer

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Javier Eguiluz
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
dir=${CURDIR}
2+
export COMPOSE_PROJECT_NAME=easy_log_bundle
3+
project=-p ${COMPOSE_PROJECT_NAME}
4+
service=${COMPOSE_PROJECT_NAME}:latest
5+
interactive:=$(shell [ -t 0 ] && echo 1)
6+
ifneq ($(interactive),1)
7+
optionT=-T
8+
endif
9+
10+
build:
11+
@docker-compose -f docker-compose.yml build
12+
13+
start:
14+
@docker-compose -f docker-compose.yml $(project) up -d
15+
16+
stop:
17+
@docker-compose -f docker-compose.yml $(project) down
18+
19+
restart: stop start
20+
21+
ssh:
22+
@docker-compose $(project) exec $(optionT) symfony bash
23+
24+
ssh-nginx:
25+
@docker-compose $(project) exec nginx /bin/sh
26+
27+
exec:
28+
@docker-compose $(project) exec $(optionT) symfony $$cmd
29+
30+
exec-bash:
31+
@docker-compose $(project) exec $(optionT) symfony bash -c "$(cmd)"
32+
33+
test-using-symfony-4:
34+
@make clean
35+
@make exec-bash cmd="composer create-project symfony/website-skeleton . ^4.4"
36+
@make transfer-monolog-config
37+
@make install-bundle
38+
@make cache-clear-warmup
39+
40+
test-using-symfony-5:
41+
@make clean
42+
@make exec-bash cmd="composer create-project symfony/website-skeleton . ^5.0"
43+
@make transfer-monolog-config
44+
@make install-bundle
45+
@make cache-clear-warmup
46+
47+
clean:
48+
@make exec-bash cmd="find . -delete"
49+
50+
transfer-monolog-config:
51+
@make exec-bash cmd="cp --force /tmp/monolog.yaml /var/www/html/config/packages/dev/"
52+
53+
install-bundle:
54+
@make exec-bash cmd="composer require --dev systemsdk/easy-log-bundle"
55+
56+
cache-clear-warmup:
57+
@make exec-bash cmd="bin/console cache:clear"
58+
@make exec-bash cmd="bin/console cache:warmup"
59+
60+
info:
61+
@make exec cmd="bin/console --version"
62+
@make exec cmd="php --version"
63+
64+
logs:
65+
@docker logs -f ${COMPOSE_PROJECT_NAME}_symfony
66+
67+
logs-nginx:
68+
@docker logs -f ${COMPOSE_PROJECT_NAME}_nginx

composer.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "systemsdk/easy-log-bundle",
3+
"description": "A symfony bundle that optimizes dev log messages to be processed by humans instead of software.",
4+
"keywords": [
5+
"symfony",
6+
"bundle",
7+
"log",
8+
"logging",
9+
"monolog",
10+
"easy",
11+
"productivity"
12+
],
13+
"type": "symfony-bundle",
14+
"homepage": "https://github.com/systemsdk/easy-log-bundle",
15+
"license": "MIT",
16+
"authors": [
17+
{
18+
"name": "Javier Eguiluz",
19+
"email": "[email protected]"
20+
},
21+
{
22+
"name": "Dmitriy Kravtsov",
23+
"email": "[email protected]"
24+
}
25+
],
26+
"replace": {
27+
"easycorp/easy-log-handler": "self.version"
28+
},
29+
"require": {
30+
"php": ">=7.4",
31+
"monolog/monolog": "~1.6|~2.0",
32+
"symfony/yaml": "^4.4|^5.0",
33+
"symfony/framework-bundle": "^4.4|^5.0"
34+
},
35+
"autoload": {
36+
"psr-4": {
37+
"Systemsdk\\Bundle\\EasyLogBundle\\": "src/"
38+
}
39+
}
40+
}

docker-compose.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
version: '3'
2+
3+
services:
4+
5+
nginx:
6+
image: nginx:latest
7+
build:
8+
context: ./docker/
9+
args:
10+
- "BUILD_ARGUMENT_ENV=dev"
11+
dockerfile: ./nginx/Dockerfile
12+
container_name: ${COMPOSE_PROJECT_NAME}_nginx
13+
restart: always
14+
ports:
15+
- 80:80
16+
- 443:443
17+
volumes:
18+
- ./docker/src:/var/www/html:ro
19+
depends_on:
20+
- symfony
21+
links:
22+
- symfony
23+
24+
symfony: &symfony-template
25+
image: symfony:latest
26+
build:
27+
context: .
28+
args:
29+
- "BUILD_ARGUMENT_ENV=dev"
30+
- "BUILD_ARGUMENT_DEBUG_ENABLED=false"
31+
dockerfile: ./Dockerfile
32+
container_name: ${COMPOSE_PROJECT_NAME}_symfony
33+
expose:
34+
- 9000
35+
volumes:
36+
- ./docker/src:/var/www/html

0 commit comments

Comments
 (0)