
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@getcircuit/server-logging
Advanced tools
@getcircuit/server-loggingThis is a logging library to be used by Circuit Backend Services.
In its essence it is a wrapper for some other logging library with a common logging interface, so we can easily change how it works without having to update the same code in all services.
Currently, we are using Pino as our logging library of choice.
This example will use an approach of having a singleton logger instance for a whole service, but this library does not enforce a single logger instance, if needed you can spawn other instances.
To use this library we need to first initialize a logger.
// logger.ts
import { createLogger } from '@getcircuit/server-logging'
export const logger = createLogger({
level: 'info',
pretty: true,
enabled: true,
})
And then we can use it anywhere:
We can log a simple message
logger.info('Starting server')
Or we can log a message with extra details
logger.info('Starting server', { address: '127.0.0.1:8080' })
Or even, if we get an error, we can use the special 'error' key to automatically spread all the error properties
try {
// try starting the server
} catch (error) {
logger.error('Error starting server', {
error,
/* ...otherProperties */
})
}
[!NOTE] This is necessary as errors in JavaScript are objects with non-enumerable properties and so JSON.stringify does not stringify the error properly if not explicitly telling it which keys to use.
This library includes a tracing instrumentation for the logger in order to be
provided to the @getcircuit/server-tracing library.
Remember that as opentelemetry instrumentations work by intercepting imports and changing them, the tracing needs to be set-up before ever importing the logging library itself.
That is why the tracing is provided in a separate export path:
@getcircuit/server-logging/tracing
An example of how to use it with @getcircuit/server-tracing:
import { setupTracing } from '@getcircuit/server-tracing'
import { getLoggerTracingInstrumentation } from '@getcircuit/server-logging/tracing'
import { tracingOptionsBase } from '@Config/tracing'
setupTracing({
...tracingOptionsBase,
extraInstrumentationOptions: [getLoggerTracingInstrumentation()],
})
This library also includes a TypeORM logger that can be used to log the queries that are being executed by TypeORM.
All queries are logged with the debug level, slow queries with the warn level, and
errors with the error level.
To use it, you need to pass the logger to the createTypeORMLogger function when setting up
the TypeORM connection:
import { DataSource } from 'typeorm'
import { createTypeORMLogger } from '@getcircuit/server-logging/typeorm'
import { postgres } from '$/config'
import { logger } from '$/logger'
export const sqlDataSource = new DataSource({
type: 'postgres',
host: postgres.host,
port: postgres.port,
username: postgres.username,
password: postgres.password,
database: postgres.database,
entities: [
// ...
],
synchronize: false,
logger: createTypeORMLogger(logger),
})
FAQs
## Logging
We found that @getcircuit/server-logging demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 19 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.