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.
@datalust/winston-seq
Advanced tools
winston-seq
A Winston v3 transport that sends structured logs to the Seq log server.
$ npm install @datalust/winston-seq winston
# Or with yarn
$ yarn add @datalust/winston-seq winston
const winston = require('winston');
const { SeqTransport } = require('@datalust/winston-seq');
// or import { SeqTransport } from '@datalust/winston-seq';
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine( /* This is required to get errors to log with stack traces. See https://github.com/winstonjs/winston/issues/1498 */
winston.format.errors({ stack: true }),
winston.format.json(),
),
defaultMeta: { /* application: 'your-app-name' */ },
transports: [
new winston.transports.Console({
format: winston.format.simple(),
}),
new SeqTransport({
serverUrl: "https://your-seq-server:5341",
apiKey: "your-api-key",
onError: (e => { console.error(e) }),
handleExceptions: true,
handleRejections: true,
})
]
});
serverUrl
- the URL for your Seq server's ingestionapiKey
- (optional) The Seq API Key to useonError
- Callback to execute when an error occurs within the transporthandleExceptions
- (optional) Send an event when an uncaught exception occurshandleRejections
- (optional) Send an event when an unhandled promise rejection occursSend structured log events, with properties that can be used later for filtering and analysis:
logger.info("Hello {name}", {name: "World"});
Attach context by creating child loggers:
const taskLogger = logger.child({ activity: "purchase" });
taskLogger.debug(
"User {user} purchase product {product} at ${price}",
{
user: "Millie Gilbert",
product: "Yardtime Garden Shears",
price: 29.99
});
Install Yarn if you don't already have it. Next, add a .env
file with content like:
SEQ_INGESTION_URL=http://192.168.98.99:5341
SEQ_API_URL=http://192.168.98.99
SEQ_API_KEY=fsf7sa9f9sf7s9df7
Where SEQ_INGESTION_URL
is the ingestion address of a test Seq server, SEQ_API_URL
is the API address of the test server and SEQ_API_KEY
is an API key with the Ingest
and Read
permissions.
$ yarn build
$ yarn test
NB. One test will fail if the Seq server is configured to require an API key.
$ yarn test:coverage
$ yarn lint
FAQs
A Winston v3 transport for Seq
The npm package @datalust/winston-seq receives a total of 13,232 weekly downloads. As such, @datalust/winston-seq popularity was classified as popular.
We found that @datalust/winston-seq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.