You've already forked dockerfiles
mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-06-14 23:55:02 +02:00
update mysql-proxy
This commit is contained in:
20
mysql-proxy/code.py
Executable file
20
mysql-proxy/code.py
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import select from systemd
|
||||
import journal
|
||||
|
||||
j = journal.Reader()
|
||||
j.log_level(journal.LOG_INFO)
|
||||
j.add_match(CONTAINER_NAME="mysql-proxy")
|
||||
j.seek_tail()
|
||||
j.get_previous()
|
||||
|
||||
p = select.poll()
|
||||
p.register(j, j.get_events())
|
||||
|
||||
while p.poll():
|
||||
if j.process() != journal.APPEND:
|
||||
continue
|
||||
for entry in j:
|
||||
if entry['MESSAGE']:
|
||||
print(str(entry['__REALTIME_TIMESTAMP']), entry['MESSAGE'])
|
Reference in New Issue
Block a user