| Timestamp | Level | Application | Component | Function / Action | Message |
|---|
Send logs from any React Native app, React/Vue web application, Node.js backend, Python service, or microservice in seconds.
import { RemoteLogger } from './utils/RemoteLogger';
// 1. Initialize once in App.js
RemoteLogger.init({
appId: 'my-mobile-app',
appName: 'My Mobile App',
hubUrl: 'http://YOUR_SERVER_IP:3000'
});
// 2. Track any function action
RemoteLogger.action('onUserLogin', 'User completed authentication', { userId: '123' });
// 3. Log errors anywhere
RemoteLogger.error('Payment failed', err, { amount: 49.99 });
async function sendHubLog(level, functionName, message, data = null, error = null) {
try {
await fetch('http://YOUR_SERVER_IP:3000/api/logs/ingest', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
appId: 'billing-service',
appName: 'Billing Service',
level,
component: 'Billing:Stripe',
functionName,
message,
data,
error: error ? { message: error.message, stack: error.stack } : null
})
});
} catch (e) {
// Fallback
}
}
curl -X POST http://localhost:3000/api/logs/ingest \
-H "Content-Type: application/json" \
-d '{
"appId": "custom-service",
"appName": "Custom Service",
"level": "INFO",
"component": "Worker",
"functionName": "processTask",
"message": "Task processed successfully",
"data": { "taskId": "T-9921", "durationMs": 45 }
}'