Today, took the time to browse the next node.js, haha, read a primer article (http://www.nodebeginner.org/index-zh-cn.html), the sense of self is getting started, but inside a sentence, quite has the sentiment:
Copy Code code as follows:
These are, after all, front-end technologies, although it always makes sense to use jquery when you want to enhance the page, but in the end, you're the most JavaScript user, not the JavaScript developer. And then, there's the Node.js, the service-side JavaScript, how cool is that? So you think it's time to pick up the familiar and unfamiliar JavaScript. But don't worry, writing node.js apps is one thing; understanding why they write in the way they write means-you have to understand JavaScript. It's a real game this time.
It's a drop, this time it's going to be real.
To say, to see a good thing Log.io, the official explanation is that:
Copy Code code as follows:
Real-time log monitoring in your browser
Powered by Node.js + Socket.io
Real-time log monitoring, we may think of Linux under the Tail-f, Log.io is also roughly this meaning, but more powerful than the TAIL-F function. This thing is also C/s structure of OH.
The following is a practical demonstration:
1, installation
This thing, rely on Nodejs, we first put Nodejs, refer to the official installation method: (http://nodejs.org/download/)
I'm using the Mac Brew installation method here:
Copy Code code as follows:
or use Yum:
Copy Code code as follows:
Then we can use NPM to install Log.io.
Copy Code code as follows:
NPM install-g log.io--user "Chenqing"
After installation, start the server (no configuration required):
Copy Code code as follows:
Configure the client after
Copy Code code as follows:
Vim ~/.log.io/harvester.conf
Exports.config = {
NodeName: "Application_server",
Logstreams: {
Test: [
"/users/chenqing/test.log"
]
},
Server: {
Host: ' 0.0.0.0 ',
port:28777
}
}
Start client: Log.io-harvester
Let's test this out:
First at the command line
Copy Code code as follows:
[chenqing@qing ~] for i in {1..1000};d o echo ' Date ' >> test.log;d One
Open Browser: http://localhost:28778/