Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongotail [db] --follow exits after 1 second #24

Open
kevinburke opened this issue Aug 29, 2017 · 7 comments
Open

mongotail [db] --follow exits after 1 second #24

kevinburke opened this issue Aug 29, 2017 · 7 comments

Comments

@kevinburke
Copy link

I installed the tool and am running mongotail [db] --follow. I expect that the command will block until I kill it with ctrl+c. Instead, it exits after 1 second, without printing anything.

It would be good if it warned that you needed to run with --level=2, if --level=2 was the default mode, or otherwise displayed a warning or error, instead of exiting without displaying any messages.

@kevinburke
Copy link
Author

Running mongotail accounts --level=1 -f sets the level and then exits. I expect that it would set the level, and then start following the database.

All of these make it difficult to script mongotail, or to explain how to others to use it; I'm looking for something that can immediately start tailing the database logs.

@mrsarm
Copy link
Owner

mrsarm commented Aug 29, 2017

@kevinburke You are right. It would be a good improvements, and the last behavior is a bug actually. I'll try to implement the changes, but it will not be soon. Patchs are welcome :)

@ghost
Copy link

ghost commented Jul 23, 2018

It always just exits for me. I can't get it to work.

@kevinburke
Copy link
Author

FWIW, I implemented a tool that has the behavior I want, https://github.com/kevinburke/read-mongo-logs

@mrsarm
Copy link
Owner

mrsarm commented Jul 24, 2018

@errorx666 did you solve the issue?

Did you activate first the profiler with the -l option?

Mongotail has the same syntax to connect to a database that the command mongo provided by any MongoDB distribution, did you try to connect within the same console to the database with the same params but using the mongo command?

For instance, if you are executing mongotail myhost/mydatabase, you can try the same but using mongo command like this: mongo myhost/mydatabase. If you cannot connect to the database using this command, it's a connection issue. Try also connect with mongotail using the --verbose option.

@serkandemirel0420
Copy link

@errorx666 indeed, it did not work for me either. verbose did not do the trick either. connection confirmed.

@mrsarm
Copy link
Owner

mrsarm commented Apr 2, 2019

@errorx666 ,

Lets say you try to connect with your database with:

$ mongotail hostname/mydb -l 2
$ mongotail hostname/mydb -f

Can you try in the same machine execute:

$ mongo hostname/mydb

(note that you have to make the test in the same machine, using the same connection string, in the example hostname/mydb, but using the MongoDB mongo CLI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants