mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-38648 Log bound address/port at startup
This commit is contained in:
parent
93bec638a4
commit
a8bf642269
15
jstests/noPassthrough/bind_localhost.js
Normal file
15
jstests/noPassthrough/bind_localhost.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Log bound addresses at startup.
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
const mongo = MongoRunner.runMongod({ipv6: '', bind_ip: 'localhost', useLogFiles: true});
|
||||
assert.neq(mongo, null, "Database is not running");
|
||||
const log = cat(mongo.fullOptions.logFile);
|
||||
print(log);
|
||||
assert(log.includes('Listening on 127.0.0.1'), "Not listening on AF_INET");
|
||||
if (!_isWindows()) {
|
||||
assert(log.match(/Listening on .*\.sock/), "Not listening on AF_UNIX");
|
||||
}
|
||||
MongoRunner.stopMongod(mongo);
|
||||
}());
|
@ -776,6 +776,7 @@ Status TransportLayerASIO::start() {
|
||||
for (auto& acceptor : _acceptors) {
|
||||
acceptor.second.listen(serverGlobalParams.listenBacklog);
|
||||
_acceptConnection(acceptor.second);
|
||||
log() << "Listening on " << acceptor.first.getAddr();
|
||||
}
|
||||
|
||||
_listenerThread = stdx::thread([this] {
|
||||
|
Loading…
Reference in New Issue
Block a user