-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Logging with nodemon #153
Comments
Do you have a simple example that replicates this problem - because I use logging a lot in my projects, and use nodemon nearly exclusively and not heard of this problem before. Also useful to know what platform you're running on to replicate the issues to help debug it. Thanks. |
Thanks for being so fast! Here you have an example (just proxying a request) and it does not work: node_test.js var http = require('http'), // Here is how it works:
sudo nodemon node_test.js 26 Mar 10:05:56 - [nodemon] v0.7.3 The platform is an Ubuntu 12.04.1 LTS |
I'm trying to replicate this, but still getting the logging. Two important questions:
I'm doing: But looking at the http-proxy, I'm not sure that's the right port. When I ran the code (without sudo - because without I can still bind both 9000 and 8888) and I curl port 8888 I get:
|
Answering your questions:
If you do the curl in the port 8888 it forwards the request to the 9000 port, where the server is listening. If I run with node, I can see "LOGGING" in the console, but not with nodemon. I have also tried a more simple example and it still does not work with nodemon: var http = require('http'), http.createServer(function (request, response) { console.log('Server running at http://127.0.0.1:8888/'); In this example: For testing:
Server logging with node:
Server loggin with nodemon:
As you can see, it logs "Server running at http://127.0.0.1:8888/" with node but nothing with nodemon. I don't know what else I could do... |
Your simple example doesn't have any logging in it... |
In the example I have written: console.log('Server running at http://127.0.0.1:8888/'); |
Oh - sorry, I spotted the console.log at the end. I've just tried the same thing and it's working exactly as expected on ubuntu 12.04.2:
I'm not sure what to do next... |
Are you able to get the I'm wondering if in fact it's not even running node and your script. |
What version of node.js are you running? This was just filed |
Yes, the script is working and I get the "Hello Worl". Maybe you are right and it's the version of the nodejs. I installed from the repository and it is the 0.6.12. Could it be the reason? |
I think so, particularly going by #154. Are you able to upgrade? I'm going to investigate this logging issue on 0.6.x - but I'm not sure I should justify supporting stable-2 versions. I'm conflicted over this! |
Exactly, that was the reason. I have downloaded the nodejs v0.10.1 and it has worked perfectly. Thank you very much! |
Also going to push a change that fixes logging for 0.6.x. |
I also face with same issue, my code is as follow
and nodemon as follows
I currently working on OSX Yosemite, node verison is 1.0.4 |
I got the same problem with iojs v1.2.0 and nodemon v1.2.1. Upgrading to nodemon v1.3.7 fixed it for me. |
@alanshaw thank for the answer ... I also had this issue, for me updating from |
can i use nodemon and foever together.. I used it but imnot able to see console.log |
Hey everyone!
I am using console.log for loggin but it does not work with nodemon. It works when I started the server with node but not with nodemon.
I have been reading that it can be because of the version, but I have the 0.7,3 and it should work. Could anyone help me?
Thanks in advance!
The text was updated successfully, but these errors were encountered: