Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak MySQL logs setup #5222

Merged
merged 2 commits into from
Dec 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions mysql/tests/compose/mariadb.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[mysqld]
# Activate all logs (general and slow query logs aren't enabled by default),
# and locate them all under the same folder so we can easily share them
# with the Agent container.
general_log = on
general_log_file = /opt/bitnami/mariadb/logs/mysql.log
log_error = /opt/bitnami/mariadb/logs/mysql_error.log
slow_query_log = on
slow_query_log_file = /opt/bitnami/mariadb/logs/mysql_slow.log
long_query_time = 0.1 # Facilitates local slow query log testing.
# log_short_format=ON # Uncomment to simulate short log format.

# Slow logs aren't enabled by default, so we enable and configure them here
# to save us some manual configuration when developing.
slow_query_log = 1
slow_query_log_file = /opt/bitnami/mariadb/logs/slow.log
long_query_time = 0.1
2 changes: 1 addition & 1 deletion mysql/tests/compose/mariadb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
ports:
- "${MYSQL_PORT}:3306"
volumes:
- ${MYSQL_CONF_PATH}:/bitnami/mariadb/conf/my_custom.cnf:ro
- ${MYSQL_CONF_PATH}:/opt/bitnami/mariadb/conf/my_custom.cnf:ro

mysql-slave:
container_name: mysql-slave
Expand Down
18 changes: 13 additions & 5 deletions mysql/tests/compose/mysql.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
[mysqld]
# Activate all logs (general and slow query logs aren't enabled by default),
# and locate them all under a shared folder so we can easily share them
# with the Agent container.
general_log = on
general_log_file = /var/log/mysql/mysql.log
log_error = /var/log/mysql/mysql_error.log
slow_query_log = on
slow_query_log_file = /var/log/mysql/mysql_slow.log
long_query_time = 0.1 # Facilitates local slow query log testing.
# log_short_format=ON # Uncomment to simulate short log format.

# Slow logs aren't enabled by default, so we enable and configure them here
# to save us some manual configuration when developing.
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 0.1
[mysqld-8.0]
general_log_file = /opt/bitnami/mysql/logs/mysql.log
log_error = /opt/bitnami/mysql/logs/mysql_error.log
slow_query_log_file = /opt/bitnami/mysql/logs/mysql_slow.log
2 changes: 2 additions & 0 deletions mysql/tests/compose/mysql8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ services:
- MYSQL_DATABASE=my_database
ports:
- "${MYSQL_PORT}:3306"
volumes:
- ${MYSQL_CONF_PATH}:/opt/bitnami/mysql/conf/my_custom.cnf:ro

mysql-slave:
container_name: mysql-slave
Expand Down