Comments (7)
nvm, I just lack understanding of android in general.
The file does get created, just not in a place when the user can access it from the gui.
@codemap01 in case of RNFS the default path is /data/user/0/com.yourapp/files
. You can access it via android studio > View > Tool Windows > Device File Explorer
from react-native-logs.
@shahanshah87 I have searched all hidden files in the Android folder of File Manager but it's not visible to me so how can I change my path? can you share with code example.
from react-native-logs.
console.log(RNFS.CachesDirectoryPath);
console.log(RNFS.ExternalCachesDirectoryPath);
console.log(RNFS.DownloadDirectoryPath);
console.log(RNFS.DocumentDirectoryPath);
console.log(RNFS.ExternalDirectoryPath);
console.log(RNFS.ExternalStorageDirectoryPath);
console.log(RNFS.TemporaryDirectoryPath);
Output:
LOG /data/user/0/com.seedao.app/cache
LOG /storage/emulated/0/Android/data/com.seedao.app/cache
LOG /storage/emulated/0/Download
LOG /data/user/0/com.seedao.app/files
LOG /storage/emulated/0/Android/data/com.seedao.app/files
LOG /storage/emulated/0
LOG /data/user/0/com.seedao.app/cache
So RNFS.ExternalCachesDirectoryPath
is the best choose!
Following is my code:
import {logger, consoleTransport, fileAsyncTransport} from 'react-native-logs';
import RNFS from 'react-native-fs';
const config = {
transport: __DEV__ ? consoleTransport : fileAsyncTransport,
severity: __DEV__ ? 'debug' : 'error',
transportOptions: {
colors: {
info: 'blueBright',
warn: 'yellowBright',
error: 'redBright',
},
FS: RNFS,
filePath: RNFS.ExternalCachesDirectoryPath,
fileName: 'logs_{date-today}.log',
},
};
const log = logger.createLogger(config);
export {log};
so I can find the log files in my FileManger easily.
from react-native-logs.
I'm experiencing the same issue using the configuration from the docs.
from react-native-logs.
@Rankarusu Thanks, I'm able to see the logs.txt
file in Android studio Device File Explorer
but In my real (physical )device I'm not able to see this logs.txt
file so how can able to see this file in my device?
from react-native-logs.
@codemap01 search in Android folder of File Manager or try changing the path.
from react-native-logs.
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.
from react-native-logs.
Related Issues (20)
- I'm not able to generate and save(see) log in file manager (storage) of mobile device HOT 1
- how we can access log.txt file in iOS device HOT 5
- Queue? HOT 1
- Open to adding custom formatting support? HOT 2
- Sentry transporter seems to log always to error despite using info/debug.. HOT 2
- Is it possible to store file in Zip(compressed log.txt file) with in cache directory HOT 1
- NSMallocException - Expo device build fatal crash with FileAsyncTransport HOT 1
- Is there a way to pass types to transport function props? HOT 1
- today date formatting is incorrectly described in the docs HOT 1
- Logging to a log level with undefined transport causes app to crash HOT 2
- Using react-native-logs in a regular 'react' web app? HOT 2
- Date format with using {date-today} HOT 1
- use withScope to sentry's message logging?
- Logs cluttered with unformatted component trees
- Logs are not showing color on metro bundler for React native
- nested object does not show HOT 6
- Request for a new feature HOT 2
- Log level always "LOG" for every severity on metro bundler for React native HOT 1
- fileAsyncTransport Error when using it from separate local package
- Typescript complaints about logger definition HOT 1
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 react-native-logs.