Seperate crash-resistant thread?

Discussion in 'Plugin Development' started by LRFLEW, Apr 7, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    LRFLEW

    I have a plugin that logs commands (called Commands Logging; isn't my naming skills epic :p), and I was looking into how often to flush the log. I could just do it when it quits, but that runs into the huge threat of loosing a ton of logging if the server crashes. Is there a way to setup a separate computational thread to hold the log, have it tell if the server is up or not, and when it notices the server has been stopped, either naturally or forcibly, flush the log?

    Really? The one about ebean, which has thousands of threads to it's topic, gets 6 responses and I get NONE?!?1

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  2. Offline

    Carnes

    I'm sure people aren't ignoring you. It's just an unpopular topic. My guess is you can't use a child thread, it'll have to be completely external and connect to your plugin with some sort of IPC. But to be honest, that sounds like too much work : / I'd rather setup mysql and constantly push data to it, hah. Or just flush to file every minute or so..
     
  3. Offline

    Ne0nx3r0

    People tend to go for low hanging fruit; the more dumbed down you can make it the more they feel safe answering... I don't know how many people feel safe giving you advice on this topic.

    So... you're smarter than us ; )
     
  4. Offline

    Kekec852

    You could just make Que ... When somthing needs to be logged you put into que. And you write que into file every 100 entry or 30 minutes and on exit. And you could add a shutdown hook and write the data then.
     
  5. Offline

    LRFLEW

    Yeah... unpopular :p
    Too much work is too much.
    Sounds like what I'm already doing is good.

    I wouldn't say I'm smatter than ya'll (and yes, I said ya'll :p), but that I should try somewhere like stackoverflow.com to get answers to hard questions.

    Sort of what I'm doing (only without the # of entries part; may add that)
    That's helpful. Thanks.
     
Thread Status:
Not open for further replies.

Share This Page