Giter Site home page Giter Site logo

Comments (10)

megastef avatar megastef commented on May 23, 2024

I doubt that this is related to exit handlers.
Signals are recognized (SIGINT, SIGQUIT, SIGTERM).
https://github.com/sematext/logagent-js/blob/1.x/bin/logagent.js#L524-#L526

The invalid position is from the tailForever.unwatch() (or a bug in reading the postion before it gets stored). https://github.com/sematext/logagent-js/blob/master/lib/fileManager.js#L141

Was the file renamed? How can this error be re-produced?

from logagent-js.

megastef avatar megastef commented on May 23, 2024

You could get some more log messages (on stderr, stored e.g. in /var/log/upstart/logagent.log when you use the upstart service). Set following environment variables

export LOG_TAIL_FILE_INFO=1
export DEBUG=1

from logagent-js.

erik-stephens avatar erik-stephens commented on May 23, 2024

Thanks, that will help. By the way, I'm running this as a spawned process in the shell and not daemonized. Not renaming files, although I ran it multiple times against different files (full log file vs a small subset). I'll figure out how to reproduce and probably submit a PR. A PR for this should go against 1.x branch?

from logagent-js.

megastef avatar megastef commented on May 23, 2024

Yes please 1.x - 2.x needs to get in shape, working on plugins.

Do you use --diskBufferDir /tmp/logagent ? The file is always stored in this directory. So you run it with different file sets. I could imagine that an old file gets into the list (it was stored), but LA never started a tail process on it, then it tries to unwatch - but I did not check this.

from logagent-js.

erik-stephens avatar erik-stephens commented on May 23, 2024

I think I was able to narrow down the issue. My nodejs-fu is not strong enough to add much more insight at this point. I worry about getting a response since that repo has no commits for almost 2 years. Hopefully someone here has some insight.

from logagent-js.

megastef avatar megastef commented on May 23, 2024

Published on npm - I will watch the tailF repository. We should consider a fork or alternative library.

from logagent-js.

erik-stephens avatar erik-stephens commented on May 23, 2024

Thanks for the workaround but I worry it will try to read the entire file into memory since maxSize defaults to -1. I think I have a fix in this PR.

from logagent-js.

megastef avatar megastef commented on May 23, 2024

Thanks for catching this! Please ping when a new npm version is available. So I will remove "bufferSize: -1" again.

from logagent-js.

megastef avatar megastef commented on May 23, 2024

Oh, its on npm already:tail-forever 0.3.12 :)

from logagent-js.

megastef avatar megastef commented on May 23, 2024

Made a quick test and release with updated dependency. Release: 1.2.25.

from logagent-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.