Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
winston-fms-transport
Advanced tools
Readme
A transport to support logging via winston to FileMaker Server
npm install --save winston-fms-transport
This is a winston log transport designed to send logs to a FileMaker file via the Data API. This transport uses fms-api-client and marpat. To use this transport you must first call marpat's connect function. Marpat is designed to allow the use of multiple datastores with the focus on encrypted file storage and project flexibility. Once connected to marpat, a FileMaker transport will be created and used to transfer logs. Note that if connect is not called, this transport will log a message to the console but not throw an error.
connect('nedb://memory')
.then(db => {
Excerpt from ./example.js
A transport is defined with the following properties. Note the infoField
, messageField
, and layout
properties. The layout property specifices the layout to use in Filemaker when creating log records. The infoField
will be used for the log data and the messageField
will be used for the log message. All other properties conform the the properties required by the fms-api-client.
const filemakerTransport = level =>
new FilemakerTransport({
application: process.env.APPLICATION,
server: process.env.SERVER,
user: process.env.USERNAME,
password: process.env.PASSWORD,
level: level,
infoField: 'info',
messageField: 'message',
layout: process.env.LAYOUT
});
Excerpt from ./example.js
Once a transport is created it can be added to a logger instance like any other transport.
const logger = createLogger({
transports: [filemakerTransport('info')],
exitOnError: false
});
Excerpt from ./example.js
Once defined, the logger can be called from within the node application and logs of the appropriate level will be sent to FileMaker.
logger.silly('Message', { db: 'this is a message' });
Excerpt from ./example.js
npm install
npm test
> winston-fms-transport@1.0.2 test /Users/luidelaparra/Documents/Development/winston-fms-transport
> nyc _mocha --recursive ./tests --timeout=30000
Agent Tests
✓ should have a log function
✓ should should not throw an error if connect has not been called
Client Test
✓ should reject if it can not send a message
✓ should reuse the same client to try and send a message
Log Test
✓ should be able send a log to FileMaker
✓ should be able send multiple messages on the same client
Transport Tests
✓ should have a log function
✓ should return true without a callback
✓ should return true with a callback (271ms)
✓ should reject and log an error if there is an error (105ms)
10 passing (454ms)
---------------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------|----------|----------|----------|----------|-------------------|
All files | 100 | 83.33 | 100 | 100 | |
winston-fms-transport | 100 | 100 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
winston-fms-transport/src | 100 | 83.33 | 100 | 100 | |
index.js | 100 | 100 | 100 | 100 | |
transport.model.js | 100 | 83.33 | 100 | 100 | 52 |
---------------------------|----------|----------|----------|----------|-------------------|
MIT © Lui de la Parra
FAQs
A transport to support logging via winston to FileMaker Server
The npm package winston-fms-transport receives a total of 7 weekly downloads. As such, winston-fms-transport popularity was classified as not popular.
We found that winston-fms-transport 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.