
React Native Logging: console.log, LogBox, Native Logs, JS Errors and Remote Logging
In React Native, console.log looks exactly like it does in a browser. That's the trap.
Your JavaScript runs in one thread, but every line it logs ends up in a native log: Logcat on Android, the unified log on iOS. Where you read it has moved twice since 2024: Flipper left React Native, and then the Metro terminal stopped showing logs. And in a release build, a whole class of errors disappears without leaving a line anywhere: an unhandled promise rejection that showed a red LogBox error on your desk does nothing at all on your users' phones.
This guide covers where React Native logs go in development, where they go on the device, what happens to them in release builds, how to catch JavaScript errors, and how to get the logs from your users' phones.
console.log in Development: DevTools, Metro and Where Flipper Went
The console methods are all there — log, info, warn, error, debug, plus table and group:
console.log('Rendering cart', items.length);
console.info('Order submitted', orderId);
console.warn('Payment retry', attempt + 1, 'of 3');
console.error('Payment failed', error);
For years these lines showed up in the terminal running Metro. They don't anymore. React Native 0.76 deprecated log forwarding through Metro and 0.77 removed it, so a current React Native CLI project prints nothing there. Expo is the exception: Expo CLI still streams logs to its terminal.
The place to read them now is React Native DevTools, the built-in debugger. Press j in the Metro terminal, or choose Open DevTools from the Dev Menu (shake the device, or Ctrl+Cmd+Z on the iOS Simulator, Cmd+M on an Android emulator). Its Console panel filters by level and text and lets you expand objects, as in a browser. And since Hermes buffers console calls in the background, the lines written before you opened DevTools are there too.
And Flipper? React Native 0.73 deprecated its built-in Flipper integration, and 0.74 removed it from new projects. Flipper still exists as a standalone tool for native apps, but the React Native team's advice is to use the native tooling in Android Studio and Xcode instead — which turns out to be good advice for logging, as we'll see below.
LogBox: Warnings and Errors on the Screen
Some lines don't wait for you to open a console. LogBox puts them on the screen of the app itself, in debug builds.
console.warn shows a yellow notification at the bottom of the screen. console.error shows a red one with a count; tap it to see the message, the stack trace and the other errors. A fatal error — a syntax error, an exception nothing caught — opens LogBox full screen, and it can't be dismissed until the code is fixed.
You can silence the noise you can't fix, such as a warning from a third-party library:
import { LogBox } from 'react-native';
LogBox.ignoreLogs([
'Warning: componentWillReceiveProps has been renamed',
/GraphQL error: .*/,
]);
LogBox.ignoreAllLogs() hides everything, which is useful for a demo and dangerous the rest of the time. Note what these do, though: they hide the notification, not the line, which still goes to DevTools and to the native log.
LogBox, the Dev Menu and DevTools are all disabled in release builds. On your users' phones, a warning is just a line in a log.
Where console.log Really Goes: Logcat and Xcode
Under the hood, React Native's console hands every line to native code, in debug and release builds alike.
On Android, each line becomes a Logcat line with the tag ReactNativeJS, at Info for console.log, Warning for console.warn and Error for console.error. React Native's own native code logs under the tag ReactNative. So with the phone connected:
# Only React Native's lines: your JavaScript and the framework
adb logcat "ReactNativeJS:V ReactNative:V *:S"
# Dump what's in the buffers to a file and exit
adb logcat -d > android-log.txt
In Android Studio's Logcat, package:mine tag:ReactNativeJS does the same.
On iOS, each line goes to the unified log under the subsystem com.facebook.react.log, category javascript. When you run from Xcode, the lines show in its console. With a device connected, open the Console app on your Mac, select the device, and search for subsystem:com.facebook.react.log. One catch: console.log and console.warn are written at the unified log's Info level, which Console hides until you turn on Action › Include Info Messages. For the Simulator, from the terminal:
xcrun simctl spawn booted log stream --level info --predicate 'subsystem == "com.facebook.react.log"'
The native logs are also where your native modules write — a Kotlin Log.d or a Swift Logger call sits right next to the JavaScript lines, in order. When a bug crosses the bridge between the two, that's the only place you see both sides. Everything about these tools — Logcat filters, adb bugreport, the log buffers, unified logging and Console.app — works the same for a React Native app; I covered them in Android Logging in Kotlin and iOS Logging in Swift.
What they have in common is that you need the phone, connected to your computer.
console.log in Release Builds
console.log doesn't know about build types. In a release build every call still runs, still formats its arguments on the JavaScript thread, and still writes to Logcat or the unified log — where nobody reads it, except anyone with adb and your app on their phone.
The React Native docs warn that console calls can be a big bottleneck on the JavaScript thread in a bundled app, and recommend babel-plugin-transform-remove-console to remove them from production builds. Install it, then turn it on for production in your Babel config — .babelrc here; babel.config.js takes the same env key:
npm install --save-dev babel-plugin-transform-remove-console
{
"env": {
"production": {
"plugins": ["transform-remove-console"]
}
}
}
For a single line, the global __DEV__ does the same job by hand: it's true in a debug build and false in a release build, so the minifier drops the whole block:
if (__DEV__) {
console.log('Cart', JSON.stringify(cart));
}
Notice what this does, though — the same thing R8 does for Log.d on Android: the release build is quieter, so the lines that would explain a production bug don't exist anywhere. That's the right trade only while nobody can read them.
react-native-logs: Levels, Namespaces and Transports
console has no real levels you can turn down and no notion of where a line came from. Most React Native apps that take logging seriously use a library, and react-native-logs is the common one:
import { logger, consoleTransport } from 'react-native-logs';
const log = logger.createLogger({
severity: __DEV__ ? 'debug' : 'warn',
transport: consoleTransport,
async: true,
});
const checkoutLog = log.extend('checkout');
checkoutLog.debug('Applying coupon', code);
checkoutLog.error('Payment failed', error);
severity is the lowest level that gets written; extend creates a namespaced logger, and enabledExtensions lets you turn on only the namespaces you're debugging. async: true moves the work off the call, so a log line doesn't block rendering.
What makes it more than a prettier console.log is the transport: the function that decides where each line goes. If you've used Timber on Android, it plays the role of the trees. consoleTransport and mapConsoleTransport write to the console, fileAsyncTransport appends to a file with react-native-fs or expo-file-system, and there are transports for Sentry and Crashlytics. You can write your own — it's a function that receives the message, its level and its namespace — and pass several as an array.
A log file is a step forward: it survives restarts and doesn't scroll away. But it's still on the user's phone. You've moved the problem from a ring buffer to a folder.
JavaScript Errors: ErrorUtils and Unhandled Promise Rejections
The most important lines in a React Native app are the ones you didn't write: the errors.
An exception that nothing catches in an event handler, a timer or a callback goes to the global handler in ErrorUtils, a global React Native sets up. In a debug build that handler shows LogBox. In a release build, a fatal error goes to the native side, which crashes the app. To do something with these errors, wrap the handler — and call the original, or you lose LogBox in debug and the crash in release:
const defaultHandler = ErrorUtils.getGlobalHandler();
ErrorUtils.setGlobalHandler((error, isFatal) => {
report(error, isFatal);
defaultHandler(error, isFatal);
});
An error thrown while React renders takes another route. React looks for an error boundary above the component that threw. If there is none, it unmounts the whole app and hands the error to React Native as fatal — LogBox in debug, a crash in release — without passing through ErrorUtils. Your handler never sees it. An error boundary is the place to catch these, and to report them:
class ErrorBoundary extends React.Component<{ children: React.ReactNode }, { failed: boolean }> {
state = { failed: false };
static getDerivedStateFromError() {
return { failed: true };
}
componentDidCatch(error: Error, info: React.ErrorInfo) {
report(error, info.componentStack);
}
render() {
return this.state.failed ? <SomethingWentWrong /> : this.props.children;
}
}
Promises are a third story, and the one that surprises people most. Write this:
useEffect(() => {
loadCart(); // a promise nobody awaits and nobody catches
}, []);
If loadCart rejects in a debug build, LogBox shows a red error that starts with Uncaught (in promise. In a release build, nothing happens at all. React Native turns on promise rejection tracking only when __DEV__ is true — for Hermes and for the JavaScript Promise polyfill alike — and even in a debug build the rejection goes straight to React Native's exception manager, which shows LogBox, without passing through ErrorUtils. So a handler you set on ErrorUtils never sees it.
The fix is not a handler. It's to never leave a rejection unhandled — catch it where you await it, and log it there, with the error:
async function onCheckout() {
try {
await payments.charge(order);
} catch (error) {
log.e('Payment failed', error);
showPaymentError();
}
}
And report is still the question. Logging the error again puts it in the same log nobody reads.
Is there a remote logging library for React Native that uploads logs to the cloud?
Yes. Remote logging changes the trade above: an SDK in your app collects the log lines and errors and uploads them, so you can read a user's session after they report a bug — on a phone you've never touched. Those logs are worth keeping in release builds, at every level.
Full disclosure: I'm the founder of Shipbook, so here's how it works with ours. Install @shipbook/react-native and the storage package it uses:
npm install @shipbook/react-native @react-native-async-storage/async-storage
In an Expo project, use npx expo install with the same two packages. Start Shipbook once, when the app starts:
import Shipbook from '@shipbook/react-native';
Shipbook.start('YOUR_APP_ID', 'YOUR_APP_KEY');
Then log through a Shipbook logger, one per screen or module:
const log = Shipbook.getLogger('CheckoutScreen');
log.i('Order submitted', orderId);
log.w('Payment retry', attempt + 1, 'of 3');
try {
await payments.charge(order);
} catch (error) {
log.e('Payment failed', error);
}
The extra arguments work like console.log's; when the last one is an Error, Shipbook keeps its stack trace. The lines still show in DevTools and the native logs while you develop — log.e even shows in LogBox, like console.error — and they're also uploaded and grouped by user and session in the Shipbook console. They aren't console calls, so transform-remove-console leaves them in your release build.
You don't need to write the ErrorUtils handler above, or the report call in the error boundary. Since version 2.0.1, Shipbook hooks both routes itself: the global handler, and the exception manager that render errors and promise rejections go to. It records an uncaught error, a render error (with its component stack) and an unhandled promise rejection, each with its stack trace and the log lines that led up to it. Rejections are recorded in release builds too: there, Shipbook turns on the Hermes rejection tracking that React Native leaves off. After recording an error, it passes it on to React Native, so LogBox and any other crash reporter still get it. Keep the error boundary for its fallback screen, and keep the catch around each await. Shipbook recording a rejection doesn't mean anything handled it.
Three more lines connect the session to the rest of your system. Shipbook.registerUser(userId) ties it to the user who reported the bug. Shipbook.screen('Checkout'), called when the route changes — React Navigation's onStateChange is the usual place — shows which screen each line was written on. And if you add Shipbook.getSessionHeaders() to the requests your app sends to your own backend, the console links the app's session to the backend logs those requests wrote:
await fetch('https://api.example.com/checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json', ...Shipbook.getSessionHeaders() },
body: JSON.stringify(cart),
});
You still decide what's sent, in the Shipbook console and without shipping a new build — see the configuration guide. React Native remote logging with Shipbook shows what the console looks like, and the React Native integration docs cover the full API.
Where Each React Native Log Line Ends Up
Every React Native log line lands in one of five places. In React Native DevTools, if a debugger was open — or opened later, thanks to Hermes's buffer. On the screen, in LogBox, if it was a warning or an error in a debug build. In Logcat or the unified log of the phone it ran on, readable by adb, Xcode or Console.app until newer lines push it out. Nowhere, if a Babel plugin or __DEV__ stripped it, or if it was a promise rejection in a release build. Or on a server, where you can read it next week for the one user whose checkout broke.
The first four come with React Native, and you should know all of them. Only the fifth helps with the bug you can't reproduce on your own phone.
Shipbook is free to start, with up to 100,000 logs a day: create an account, add @shipbook/react-native, and the next bug report from a user comes with the logs from their phone.


