How to log deadlocks for each database separately



  • I have MariaDB 10.6.5 server with several databases. I added a line innodb_print_all_deadlocks = 1 to config file. Now all deadlocks are logged to one file /var/log/mysql/mariadb.err Is there any way to split deadlocks to separate files for each database? I need to split the log file to make a report for programer on which DB was deadlock and which tables.

    Maybe there is a tool that could help me generate a report on which database occur dedadlock and which tables



  • The fact that you want to log your Deadlocks separately by database suggests, to me, that you're seeing an awful lot of Deadlocks.

    I would suggest that you'd be far better off finding out why the Deadlocks are happening in the first place and fix that cause, rather than just trying to keep on top of the mess that they're making of your logging system.

    You should get very few, if any, Deadlocks in properly written Applications.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2