Skip to content

Keep buffer of JdbcWriter after connection loss #91

Closed
@re-thc

Description

@re-thc

Hi, currently JDBCWriter will lose logs if a connection drops or before a connection is established.

Can a replay buffer be added to deal with these situations? i.e. check connection and reconnect if required, but do not "lose" these entries. Instead add it to a queue and write them again when connect is available.

Activity

gabrielnasser

gabrielnasser commented on Mar 22, 2019

@gabrielnasser

Perhaps this could be done via the existing writing thread functionality by adding persistence to it? That way persistence can be enjoyed by any writer.

re-thc

re-thc commented on Apr 11, 2019

@re-thc
Author

There's a slight difference. If persistence happens across the board - where does this go? In a file or JDBC? Which becomes a circular problem. A global buffer would be good though - even for file so we can log before it opens.

I think slf4j does something similar with a substitute logger that gets initialized at the start and then swaps over once the real logger initializes.

pmwmedia

pmwmedia commented on Jun 19, 2019

@pmwmedia
Member

A pull request is welcome!

changed the title [-]Feature request: Buffer for JDBCWriter[/-] [+]Feature request: Keep buffer of JdbcWriter after connection loss[/+] on Jun 19, 2019
changed the title [-]Feature request: Keep buffer of JdbcWriter after connection loss[/-] [+]Keep buffer of JdbcWriter after connection loss[/+] on Aug 22, 2019
added this to the 2.4 milestone on Apr 18, 2021
modified the milestones: 2.4, 2.5 on Oct 30, 2021
pmwmedia

pmwmedia commented on Jan 26, 2022

@pmwmedia
Member

Could be solved easily inside of JdbcWriter.java

self-assigned this
on Apr 11, 2022
added a commit that references this issue on May 8, 2022
e234a16
github-actions

github-actions commented on Oct 9, 2022

@github-actions

This closed issue has been locked automatically.
However, please feel free to file a new issue.

locked as resolved and limited conversation to collaborators on Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @pmwmedia@gabrielnasser@re-thc

      Issue actions

        Keep buffer of JdbcWriter after connection loss · Issue #91 · tinylog-org/tinylog