Removal Guide
This guide helps you cleanly remove Logstyx from your project. We've designed Logstyx to be easy to remove with minimal disruption to your codebase.
Before You Remove
Export Your Data
If you want to keep your historical logs, export them before uninstalling:
- Log in to your Logstyx dashboard
- Go to Project Detail → Logs tab
- Click Export Data
- Your logs will be exported as JSONL (JSON Lines) format
- Save the
.jsonlfile to your local machine
Why JSONL? Each line is a complete JSON object, making it easy to:
- Process line-by-line for large exports
- Import into other logging tools
- Parse with any JSON parser
Data is Encrypted
Your MongoDB data is encrypted at rest. Direct database dumps won't be readable. Always export via the dashboard or API to get decrypted, usable logs.
Node.js Removal
1. Remove Auto-Instrumentation
If you're using the --require flag:
package.json:
{
"scripts": {
// Before
"start": "node --require logstyx-js-node/register app.js",
// After
"start": "node app.js"
}
}2. Remove SDK Code
Before:
const logstyx = require('logstyx-js-node')({
projectId: 'YOUR_PROJECT_ID',
apiKey: 'YOUR_API_KEY',
autoInstrument: true
});
const express = require('express');
const app = express();
// Your code
logstyx.info({ message: 'User logged in', userId: user.id });After:
// Remove logstyx require
const express = require('express');
const app = express();
// Replace with console.log or your new logging solution
console.log('User logged in', { userId: user.id });3. Uninstall Package
npm uninstall logstyx-js-node
# or
yarn remove logstyx-js-node4. Remove Environment Variables
.env:
# Remove these lines
LOGSTYX_PROJECT_ID=proj_abc123
LOGSTYX_API_KEY=key_xyz789
LOGSTYX_ENDPOINT=https://logs.company.com/api/v1/logsReact Removal
1. Remove SDK Code
Before:
import useLogstyx from 'logstyx-js-react';
function App() {
const logger = useLogstyx({
projectId: 'your_project_id',
endpoint: 'https://your-domain.com/api/v1/logs'
});
const { ErrorBoundary, Trackable } = logger;
return (
<ErrorBoundary logger={logger}>
<Trackable event="click" data={{ action: 'cta-click' }}>
<button>Get Started</button>
</Trackable>
</ErrorBoundary>
);
}After:
// Remove import
function App() {
return (
<button onClick={() => console.log('Button clicked')}>
Get Started
</button>
);
}2. Replace ErrorBoundary (Optional)
If you want to keep error boundaries, use a standard React error boundary:
import React from 'react';
class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = { hasError: false };
}
static getDerivedStateFromError(error) {
return { hasError: true };
}
componentDidCatch(error, errorInfo) {
console.error('Error caught:', error, errorInfo);
}
render() {
if (this.state.hasError) {
return <h1>Something went wrong.</h1>;
}
return this.props.children;
}
}
export default ErrorBoundary;3. Uninstall Package
npm uninstall logstyx-js-react
# or
yarn remove logstyx-js-reactReact Native Removal
1. Remove SDK Code
Before:
import logstyx from 'logstyx-js-react-native';
function App() {
const logger = logstyx({
projectId: 'your_project_id',
appid: 'com.yourcompany.app'
});
const { ErrorBoundary, Trackable } = logger;
return (
<ErrorBoundary logger={logger}>
<Trackable event="press" data={{ action: 'signup' }}>
<TouchableOpacity>
<Text>Get Started</Text>
</TouchableOpacity>
</Trackable>
</ErrorBoundary>
);
}After:
function App() {
return (
<TouchableOpacity onPress={() => console.log('Button pressed')}>
<Text>Get Started</Text>
</TouchableOpacity>
);
}2. Uninstall Package
npm uninstall logstyx-js-react-native
# or
yarn remove logstyx-js-react-nativeBrowser SDK Removal
1. Remove HTML Script Tags
Before:
<script>
window.LogstyxConfig = {
projectId: "proj_abc123",
endpoint: "https://logs.yourcompany.com/api/v1/logs"
};
</script>
<script src="logstyx-browser.min.js"></script>After:
<!-- Remove both script tags -->2. Remove Data Attributes
Before:
<button
data-logstyx-event="click"
data-logstyx-context='{"action":"signup"}'>
Sign Up
</button>After:
<button>
Sign Up
</button>3. Delete SDK File
rm public/logstyx-browser.min.js
# or wherever you stored itCore SDK Removal
1. Remove SDK Code
Before:
const { useLogstyx } = require('logstyx-js-core');
const logger = useLogstyx({
projectId: 'your_project_id',
apiKey: 'your_api_key',
signatureFunc: signatureFunc,
sendFunc: sendFunc
});
logger.info({ message: 'Application started' });After:
// Remove import and logger usage
console.log('Application started');2. Uninstall Package
npm uninstall logstyx-js-core
# or
yarn remove logstyx-js-coreSelf-Hosted Infrastructure Removal
1. Stop Docker Containers
cd logstyx
docker-compose down2. Remove Volumes (Optional - deletes all data)
This Deletes All Data
This will permanently delete your MongoDB database and all logs. Make sure you've exported your data first!
docker-compose down -v3. Remove Installation Directory
cd ..
rm -rf logstyx4. Clean Up Docker Images (Optional)
docker image prune -aMigration to Alternative Solutions
Option 1: Standard Console Logging
Replace Logstyx with console:
// Before
logger.info({ message: 'User logged in', userId: user.id });
logger.error({ message: 'Error occurred', error: err.message });
// After
console.log('User logged in', { userId: user.id });
console.error('Error occurred', { error: err.message });Option 2: Winston (Node.js)
npm install winstonconst winston = require('winston');
const logger = winston.createLogger({
level: 'info',
format: winston.format.json(),
transports: [
new winston.transports.File({ filename: 'error.log', level: 'error' }),
new winston.transports.File({ filename: 'combined.log' })
]
});
logger.info({ message: 'User logged in', userId: user.id });Option 3: Pino (Node.js - Faster)
npm install pinoconst pino = require('pino');
const logger = pino();
logger.info({ userId: user.id }, 'User logged in');Option 4: Sentry (Error Tracking)
npm install @sentry/nodeconst Sentry = require('@sentry/node');
Sentry.init({ dsn: 'YOUR_DSN' });
try {
// Your code
} catch (error) {
Sentry.captureException(error);
}Option 5: Commercial SaaS
Consider these alternatives:
- Datadog: Full observability platform
- New Relic: APM and logging
- Logtail: Simple log management
- Better Stack: Modern logging platform
Verification Checklist
After removal, verify:
- [ ] No
logstyximports in your codebase - [ ] No
data-logstyx-*attributes in HTML - [ ] Package removed from
package.json - [ ] Environment variables cleaned up
- [ ] Docker containers stopped (if self-hosted)
- [ ] Build/deploy scripts updated
- [ ] Application runs without errors
- [ ] Alternative logging solution in place (if needed)
Search for Remaining References
Use these commands to find any remaining Logstyx code:
# Search for imports
grep -r "logstyx" . --exclude-dir=node_modules
# Search for data attributes
grep -r "data-logstyx" . --exclude-dir=node_modules
# Search in package files
cat package.json | grep logstyxNeed Help?
If you encounter issues during removal:
- Check our GitHub Discussions: Common removal issues and solutions
- File an issue: Report any removal problems
- Contact support: We're here to help even during offboarding
Feedback
We'd love to know why you're leaving. Your feedback helps us improve:
- GitHub Discussions: Share your experience
- Email: feedback@logstyx.com
- Survey: 2-minute exit survey (coming soon)
Thank you for trying Logstyx! 🙏