Next.js Discord

Discord Forum

server logs in production

Unanswered
Shanks posted this in #help-forum
Open in Discord
I'm building an app in Next 15 using standalone feature but I'm not able to show logs in the production server output. I'm speaking strictly about server logs here.

I have a page and server action:

import { logThings } from "../actions";

export default function Home() {

  const hey = logThings();

  return (
    <>
      Account Management {hey}
    </>
  );
}


'use server'

import logger from '@/lib/logger'

export async function logThings() {
  logger.debug('Manage page')
  logger.info('Manage page info')
  logger.error('Manage page error')
  console.log('Manage page log')
  console.info('Manage page info 2')
  return 'Manage page log'
}


All works fine and logs well in development but I just can't make it to log in a production build.
Note that I'm running the build via: node .next/standalone/server.js

Can someone help me understand how to control logs in production builds?

0 Replies