[SERVER-733] mongod does not log anything when run as windows service Created: 11/Mar/10  Updated: 12/Jul/16  Resolved: 16/Jul/10

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 1.2.4
Fix Version/s: 1.5.5

Type: Bug Priority: Major - P3
Reporter: Steve Wagner Assignee: Mathias Stearn
Resolution: Done Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 x64


Issue Links:
Related
is related to SERVER-373 don't use cout - use log() or somethi... Closed
Participants:

 Description   

It seems mongod dose not log anything to log file when it runs as windows service. When i start the following command from cmd, it generates the logfile and starts logging. If i use the same command with --service to start the service, mongod only creates the file, but dose not append any conent.

c:\MongoDb\bin\mongod --bind_ip=127.0.0.1 --dbpath=d:\MongoDb\data --logpath=d:\MongoDb\log\mongo.txt --logappend --verbose --service



 Comments   
Comment by auto [ 16/Jul/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: require --logpath with --install SERVER-733
http://github.com/mongodb/mongo/commit/49867d033871b20bb21f91f82bdca049c47ef4bd

Comment by auto [ 15/Jul/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: Rejiggering of log file handling. should solve SERVER-733
http://github.com/mongodb/mongo/commit/d0662fd5236b6fd434bb9fac06630c15d67d16f8

Comment by Justin Dearing [ 08/Jul/10 ]

More info on redirecting stdin/stdout/stderr on windows:

http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/redirecting-standard-io.html

Comment by Justin Dearing [ 08/Jul/10 ]

SetStdHandle() seems to be the right way to implement this on windows.

http://msdn.microsoft.com/en-us/library/ms686244(VS.85).aspx

Comment by Justin Dearing [ 06/Jul/10 ]

Can't believe I never noticed that myself that noting was going to the log file I setup.

I'll try to look at that code this week see if I can write a patch.

On another note, I'm not sure if I like the concept of --service existing. The executable should determine if its running out of the service control manager or not. If you want to start the service via a command line "net stop MongoDB" works fine. I'll go consult my Windows System programming book tomorrow and see if I can implement a better SCM/Console startup pattern.

Comment by Steve Wagner [ 28/May/10 ]

Hope you can fix that soon. A logfile is really need for a production mongo server on Windows.

Comment by Eliot Horowitz (Inactive) [ 22/Mar/10 ]

our stdout trick doesn't work on windows

Generated at Thu Feb 08 02:55:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.