Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
logzio-client-side
Advanced tools
A logger for the client-side. Using Lgzio client-side logger is a secured way to log info, debug, error and warning messages from your front-end. This logger will send all your front-end logs to your backend and then to Logz.io.
A logger for the client-side. Using Lgzio client-side logger is a secured way to log info, debug, error and warning messages from your front-end. This logger will send all your front-end logs to your backend and then to Logz.io.
npm logzio-client-side
Import and build the logger on your client-side, as the following example:
import * as logzioLogger from 'logzio-client-side'
const logger = logzioLogger.Logger({
url: `http://<<your url>>api/log`
});
Parameter | Description |
---|---|
url (required) | Url to send logs to. |
prefix | prefix to add to all logs, delete if not needed |
log Level | Log level to display in the browser console, from: ERROR, WARN, INFO. Defaults to 'WARN' and 'ERROR' |
flushInterval | Interval to flush logs to server |
For an example of an elaborate logger configuration see our app demo.
Usage of the logger on the client-side:
logger.info('this is an info log');
logger.debug('this is a debug log');
logger.warn('this is a warning log');
logger.error('this is an error log');
logger.flush();
Add the following code to your server side and change the parameters below:
const logzioServerLogger = require('logzio-client-side/server');
const app = logzioServerLogger.app;
const bodyParser = logzioServerLogger.bodyParser;
const port = <<port>>;
const logzioShipper = logzioServerLogger.logzioLogger.createLogger({
token: <<logzio-shipping-token>>,
host: <<logzio-host>>,
type: "logzio-client-side",
debug: true
});
app.use(bodyParser.json());
app.use(logzioServerLogger.expressEndpoint({
uri: '/api/log', // Just an example
logger: logzioShipper,
enableCors: true
}));
app.listen(port, () => {
console.log(`Listening at http://localhost:${port}`)
})
Parameter | Description |
---|---|
port (required) | The port you are sending your logs to. |
Parameter | Description |
---|---|
logs-shipping-token (required) | Add the log shipping token for the relevant Logz.io account. This is the account you want to ship to. |
logzio-host (required) | Use the listener URL specific to the region of your Logz.io account. You can look it up here. |
Parameter | Description |
---|---|
uri (required) | URI to recieve logs at |
enableCors | Enable cross-origin requests to your logging endpoint |
For more configuration of the logzio-nodejs logger go to our docs. For an example of an elaborate logger configuration see our server demo.
FAQs
A logger for the client-side. Using Lgzio client-side logger is a secured way to log info, debug, error and warning messages from your front-end. This logger will send all your front-end logs to your backend and then to Logz.io.
We found that logzio-client-side demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.