Comments (3)
How it's setup:
Lambda Code
here' the code of the function:
exports.handler = async (event) => {
console.log('hello log', { a:42, b:'hello, world'});
console.debug('hello debug', { a:42, b:'hello, world'});
console.info('hello info', { a:42, b:'hello, world'});
console.warn('hello warn', { a:42, b:'hello, world'});
console.error('hello error', { a:42, b:'hello, world'});
console._stderr.write('[DEBUG] test log debug\n');
console._stderr.write('[INFO] test log info\n');
console._stderr.write('[WARN] test log warn\n');
console._stderr.write('[ERROR] test log error\n');
console._stderr.write('*DEBUG* test log debug\n');
console._stderr.write('*INFO* test log info\n');
console._stderr.write('*WARN* test log warn\n');
console._stderr.write('*ERROR* test log error\n');
const response = {
statusCode: 200,
body: JSON.stringify('Hello from Lambda!'),
};
return response;
};
CloudWatch logs
here's the output on cloud watch:
START RequestId: 0dd4f1d3-6aad-4e4c-8369-e395c834eefc Version: $LATEST
--
2021/02/23 02:19:46 Initializing Lambda Extension coralogix-extension
2021/02/23 02:19:46 Registering to Extensions API
2021/02/23 02:19:46 Initializing HTTP Server on 0.0.0.0:4342
2021/02/23 02:19:46 Serving HTTP Server on 0.0.0.0:4342
2021/02/23 02:19:46 Subscribing to Logs API
LOGS Name: coralogix-extension State: Subscribed Types: [platform,function]
2021/02/23 02:19:46 Successfully subscribed to Logs API: "OK"
EXTENSION Name: coralogix-extension State: Ready Events: [INVOKE,SHUTDOWN]
2021-02-23T02:19:46.615Z 0dd4f1d3-6aad-4e4c-8369-e395c834eefc INFO hello log { a: 42, b: 'hello, world' }
2021-02-23T02:19:46.635Z 0dd4f1d3-6aad-4e4c-8369-e395c834eefc DEBUG hello debug { a: 42, b: 'hello, world' }
2021-02-23T02:19:46.655Z 0dd4f1d3-6aad-4e4c-8369-e395c834eefc INFO hello info { a: 42, b: 'hello, world' }
2021-02-23T02:19:46.655Z 0dd4f1d3-6aad-4e4c-8369-e395c834eefc WARN hello warn { a: 42, b: 'hello, world' }
2021-02-23T02:19:46.655Z 0dd4f1d3-6aad-4e4c-8369-e395c834eefc ERROR hello error { a: 42, b: 'hello, world' }
[DEBUG] test log debug
[INFO] test log info
[WARN] test log warn
[ERROR] test log error
*DEBUG* test log debug
*INFO* test log info
*WARN* test log warn
*ERROR* test log error
END RequestId: 0dd4f1d3-6aad-4e4c-8369-e395c834eefc
REPORT RequestId: 0dd4f1d3-6aad-4e4c-8369-e395c834eefc Duration: 1887.56 ms Billed Duration: 1888 ms Memory Size: 128 MB Max Memory Used: 81 MB Init Duration: 202.96 ms
Coralogix logs
here's the output on coralogix:
from aws-lambda-extension.
a little bit better. but important levels, like error is still not working:
from aws-lambda-extension.
well, now the DEBUG
is still missing:
from aws-lambda-extension.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-lambda-extension.