Skip to content

Commit e7791a0

Browse files
author
username
committed
refactor: add log directory
1 parent 7965b35 commit e7791a0

File tree

11 files changed

+80
-3
lines changed

11 files changed

+80
-3
lines changed

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ $RECYCLE.BIN/
2727
.LSOverride
2828

2929
# Icon must end with two \r
30-
Icon
30+
Icon
31+
3132

3233
# Thumbnails
3334
._*
@@ -58,4 +59,5 @@ Temporary Items
5859
# Linux trash folder which might appear on any partition or disk
5960
.Trash-*
6061

61-
62+
## application
63+
*/logs/*

clear_logs.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
docker-compose down
3+
rm -rfv */logs/*

docker-compose.yml

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mysql5.5:
1111
- TZ=UTC
1212
volumes:
1313
- ./mysql5.5/conf.d:/etc/mysql/conf.d
14+
- ./mysql5.5/logs:/var/log/mysql:rw
1415
mysql5.6:
1516
image: mysql:5.6
1617
container_name: mysql5.6
@@ -24,6 +25,7 @@ mysql5.6:
2425
- TZ=UTC
2526
volumes:
2627
- ./mysql5.6/conf.d:/etc/mysql/conf.d
28+
- ./mysql5.6/logs:/var/log/mysql:rw
2729
mysql5.7:
2830
image: mysql:5.7
2931
container_name: mysql5.7
@@ -37,6 +39,7 @@ mysql5.7:
3739
- TZ=UTC
3840
volumes:
3941
- ./mysql5.7/conf.d:/etc/mysql/conf.d
42+
- ./mysql5.7/logs:/var/log/mysql:rw
4043
mysql8.0:
4144
image: mysql:8.0
4245
container_name: mysql8.0
@@ -50,6 +53,7 @@ mysql8.0:
5053
- TZ=UTC
5154
volumes:
5255
- ./mysql8.0/conf.d:/etc/mysql/conf.d
56+
- ./mysql8.0/logs:/var/log/mysql:rw
5357

5458
mariadb10.0:
5559
image: mariadb:10.0
@@ -64,6 +68,7 @@ mariadb10.0:
6468
- TZ=UTC
6569
volumes:
6670
- ./mariadb10.0/conf.d:/etc/mysql/conf.d
71+
- ./mariadb10.0/logs:/var/log/mysql:rw
6772
mariadb10.1:
6873
image: mariadb:10.1
6974
container_name: mariadb10.1
@@ -77,6 +82,7 @@ mariadb10.1:
7782
- TZ=UTC
7883
volumes:
7984
- ./mariadb10.1/conf.d:/etc/mysql/conf.d
85+
- ./mariadb10.1/logs:/var/log/mysql:rw
8086
mariadb10.2:
8187
image: mariadb:10.2
8288
container_name: mariadb10.2
@@ -90,6 +96,7 @@ mariadb10.2:
9096
- TZ=UTC
9197
volumes:
9298
- ./mariadb10.2/conf.d:/etc/mysql/conf.d
99+
- ./mariadb10.2/logs:/var/log/mysql:rw
93100
mariadb10.3:
94101
image: mariadb:10.3
95102
container_name: mariadb10.3
@@ -103,3 +110,4 @@ mariadb10.3:
103110
- TZ=UTC
104111
volumes:
105112
- ./mariadb10.3/conf.d:/etc/mysql/conf.d
113+
- ./mariadb10.3/logs:/var/log/mysql:rw

mariadb10.0/conf.d/my.cnf

+8
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ lower_case_table_names = 1
1111
default-storage-engine = InnoDB
1212
innodb_file_format = Barracuda
1313
innodb_file_per_table = 1
14+
15+
log_error = /var/log/mysql/error.log
16+
general_log_file = /var/log/mysql/general.log
17+
general_log = 0
18+
slow_query_log = 1
19+
slow_query_log_file = /var/log/mysql/slow-query.log
20+
long_query_time = 1
21+
log_queries_not_using_indexes = 1

mariadb10.1/conf.d/my.cnf

+8
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ lower_case_table_names = 1
1111
default-storage-engine = InnoDB
1212
innodb_file_format = Barracuda
1313
innodb_file_per_table = 1
14+
15+
log_error = /var/log/mysql/error.log
16+
general_log_file = /var/log/mysql/general.log
17+
general_log = 0
18+
slow_query_log = 1
19+
slow_query_log_file = /var/log/mysql/slow-query.log
20+
long_query_time = 1
21+
log_queries_not_using_indexes = 1

mariadb10.2/conf.d/my.cnf

+8
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ lower_case_table_names = 1
1111
default-storage-engine = InnoDB
1212
innodb_file_format = Barracuda
1313
innodb_file_per_table = 1
14+
15+
log_error = /var/log/mysql/error.log
16+
general_log_file = /var/log/mysql/general.log
17+
general_log = 0
18+
slow_query_log = 1
19+
slow_query_log_file = /var/log/mysql/slow-query.log
20+
long_query_time = 1
21+
log_queries_not_using_indexes = 1

mariadb10.3/conf.d/my.cnf

+8
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ skip-name-resolve
1010
lower_case_table_names = 1
1111
default-storage-engine = InnoDB
1212
innodb_file_per_table = 1
13+
14+
log_error = /var/log/mysql/error.log
15+
general_log_file = /var/log/mysql/general.log
16+
general_log = 0
17+
slow_query_log = 1
18+
slow_query_log_file = /var/log/mysql/slow-query.log
19+
long_query_time = 1
20+
log_queries_not_using_indexes = 1

mysql5.5/conf.d/my.cnf

+8
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ lower_case_table_names = 1
1111
default-storage-engine = InnoDB
1212
innodb_file_format = Barracuda
1313
innodb_file_per_table = 1
14+
15+
log_error = /var/log/mysql/error.log
16+
general_log_file = /var/log/mysql/general.log
17+
general_log = 0
18+
slow_query_log = 1
19+
slow_query_log_file = /var/log/mysql/slow-query.log
20+
long_query_time = 1
21+
log_queries_not_using_indexes = 1

mysql5.6/conf.d/my.cnf

+8
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ lower_case_table_names = 1
1111
default-storage-engine = InnoDB
1212
innodb_file_format = Barracuda
1313
innodb_file_per_table = 1
14+
15+
log_error = /var/log/mysql/error.log
16+
general_log_file = /var/log/mysql/general.log
17+
general_log = 0
18+
slow_query_log = 1
19+
slow_query_log_file = /var/log/mysql/slow-query.log
20+
long_query_time = 1
21+
log_queries_not_using_indexes = 1

mysql5.7/conf.d/my.cnf

+8
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ lower_case_table_names = 1
1111
default-storage-engine = InnoDB
1212
innodb_file_format = Barracuda
1313
innodb_file_per_table = 1
14+
15+
log_error = /var/log/mysql/error.log
16+
general_log_file = /var/log/mysql/general.log
17+
general_log = 0
18+
slow_query_log = 1
19+
slow_query_log_file = /var/log/mysql/slow-query.log
20+
long_query_time = 1
21+
log_queries_not_using_indexes = 1

mysql8.0/conf.d/my.cnf

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@ lower_case_table_names = 1
1111
default-storage-engine = InnoDB
1212
innodb_file_per_table = 1
1313
default_authentication_plugin = mysql_native_password
14-
local-infile = 1
14+
local-infile = 1
15+
16+
log_error = /var/log/mysql/error.log
17+
general_log_file = /var/log/mysql/general.log
18+
general_log = 0
19+
slow_query_log = 1
20+
slow_query_log_file = /var/log/mysql/slow-query.log
21+
long_query_time = 1
22+
log_queries_not_using_indexes = 1

0 commit comments

Comments
 (0)