winstonjs/node-loggly là một trong những repo mã nguồn mở mà TopGit theo dõi, hiện có 233 sao, viết chủ yếu bằng JavaScript. A client implementation for Loggly in node.js
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A client implementation for Loggly in node.js. Check out Loggly's Node logging documentation for more.
Usage
The node-loggly library is compliant with the Loggly API. Using node-loggly is easy for a variety of scenarios: logging, working with devices and inputs, searching, and facet searching.
Getting Started
Before we can do anything with Loggly, we have to create a client with valid credentials. We will authenticate for you automatically:
var loggly = require('loggly');
var client = loggly.createClient({
token: "your-really-long-input-token",
subdomain: "your-subdomain",
auth: {
username: "your-username",
password: "your-password"
},
//
// Optional: Tag to send with EVERY log message
//
tags: ['global-tag']
});
Logging
There are two ways to send log information to Loggly via node-loggly. The first is to simply call client.log with an appropriate input token:
client.log('127.0.0.1 - Theres no place like home', function (err, result) {
// Do something once you've logged
});
Note that the callback in the above example is optional, if you prefer the 'fire and forget' method of logging:
client.log('127.0.0.1 - Theres no place like home');
Logging with Tags
If you're using Loggly's tags functionality, simply include an array of tags as the second argument to the log method:
client.log('127.0.0.1 - Theres no place like home', [ 'dorothy' ], function (err, result) {
// Do something once you've logged
});
note Tags passed into the log function will be merged with any global tags you may have defined.
Logging Shallow JSON Objects as a String
In addition to logging pure strings it is also possible to pass shallow JSON object literals (i.e. no nested objects) to client.log(..) or input.log(..) methods, which will get converted into the Loggly recommended string representation. So
var source = {
foo: 1,
bar: 2,
buzz: 3
};
input.log(source);
will be logged as:
foo=1,bar=2,buzz=3
Logging JSON Objects
It is also possible to log complex objects using the new JSON capabilities of Loggly. To enable JSON functionality in the client simply add 'json: true' to the configuration:
It is possible to send arrays, which will result in one single request to Loggly.
input.log([ {iam:'number 1'}, {iam:'number 2'} ])
Searching
Searching with node-loggly is easy. All you have to do is use the search() method defined on each Loggly client:
var util = require('util');
client.search('404', function (err, results) {
// Inspect the result set
console.dir(results.events);
});
The search() method can also take an Object parameter that allows you to set additional search parameters such as: rows, from, until, etc.
var util = require('util');
client.search({ query: '404', rows: 10 })
.run(function (err, results) {
// Inspect the result set
console.dir(results.events);
});
See the Loggly search guide for more details on how to effectively search through your Loggly logs.
Installation
Installing npm (node package manager)
$ curl http://npmjs.org/install.sh | sh
Installing node-loggly
$ npm install loggly
Run Tests
All of the node-loggly tests are written in vows, and cover all of the use cases described above. You will need to add your Loggly username, password, subdomain, and a two test inputs to test/data/test-config.json before running tests. When configuring the test inputs on Loggly, the first test input should be named 'test' using the HTTP service. The second input should be name 'test_json' using the HTTP service with the JSON logging option enabled:
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/winstonjs/node-loggly là nguồn chính thức.
winstonjs/node-loggly có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho winstonjs/node-loggly. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
winstonjs/node-loggly có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho winstonjs/node-loggly. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
winstonjs/node-loggly có trang demo không?
Dự án có trang chủ ở http://github.com/winstonjs/node-loggly. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
winstonjs/node-loggly còn đang phát triển không?
Commit gần nhất trên winstonjs/node-loggly là 2.0 năm trước (theo timestamp GitHub). Repo có 83 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về node-loggly?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về node-loggly.