logger-node | A nodejs logger client for LogDNA
kandi X-RAY | logger-node Summary
kandi X-RAY | logger-node Summary
Previous versions of this client are still supported, but if you are upgrading to this version, please see our migration document for the differences between this version and prior versions.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates an instance of Convenience methods .
- Create logging instance .
- create a logger
- Generate a random number between min and max
logger-node Key Features
logger-node Examples and Code Snippets
Community Discussions
Trending Discussions on logger-node
QUESTION
EDIT : I harcoded the fluentd service IP directly in my express app and its working.. how to get it work without harcoding ip?
I have a couple of pods (nodejs + express server) running on a Kubernetes cluster.
I'd like send logs from my nodejs pods to a Fluentd DeamonSet.
But I'm getting this error :
Fluentd error Error: connect ECONNREFUSED 127.0.0.1:24224
I'm using https://github.com/fluent/fluent-logger-node and my configuration is pretty simple:
...ANSWER
Answered 2020-Sep-21 at 06:13Focusing on below parts of the question:
I'd like send logs from my nodejs pods to a Fluentd DeamonSet.
EDIT : I harcoded the fluentd service IP directly in my express app and its working.. how to get it work without harcoding ip?
It looks like the communication between pods and the fluentd
service is correct (hardcoding the IP works). The issue here is the way they can communicate with each other.
You can communicate with service fluentd
by its name. For example (from the inside of a pod):
curl fluentd:24224
You can communicate with services by its name (like fluentd
) only in the same namespace. If a service is in another namespace you would need to use it's full DNS name. It's template and example is following:
- template:
service-name.namespace.svc.cluster.local
- example:
fluentd.kube-system.svc.cluster.local
You can also use service of type ExternalName
to map the full DNS name of your service to a shorter version like below:
Assuming that (example):
- You have created a
nginx-namespace
namespace:$ kubectl create namespace nginx-namespace
- You have an
nginx
Deployment
inside thenginx-namespace
and a service associated with it:$ kubectl create deployment nginx --image=nginx --namespace=nginx-namespace
$ kubectl expose deployment nginx --port=80 --type=ClusterIP --namespace=nginx-namespace
- You want to communicate with
nginx
Deployment
from another namespace (i.e.default
)
You have an option to communicate with above pod:
- By the IP address of a
Pod
10.98.132.201
- By a (full) DNS service name
nginx.nginx-namespace.svc.cluster.local
- By an
ExternalName
type of service that points to a a (full) DNS service namenginx-service
The example of ExternalName
type of service:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install logger-node
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page