mowispace/react-native-logs

I'm not able to generate and save(see) log in file manager (storage) of mobile device

codemap01 opened this issue · 1 comments

I'm able to see the testLogs.txt file in Android Studio Device File Explorer but On my real (physical )device I'm not able to see this testLogs.txt file so how can able to see this file on my device?

`import { logger, fileAsyncTransport } from 'react-native-logs';

var RNFS = require('react-native-fs');
const log = logger.createLogger({
levels: {
debug: 1,
info: 2,
warn: 3,
error: 4,
},
transport: fileAsyncTransport,
transportOptions: {
FS: RNFS,
fileName: testLogs.txt,
},
});
log.debug('This is a Debug log 1');
export const LoggerUI = () => {
log.debug('This is a Debug log=>TEST12 ');
log.info('This is an Info log=> TEST 23');
log.warn('This is a Warning log=> TEST 34');
log.error('This is an Error log=> TEST 12345678');
return true;
};`

I added a demo file (demo/ComponentReadLogsRN.tsx) for implementing a simple component to display log files in a React Native app, it might be helpful for you.