Blog

Brad Wood

December 22, 2017

Spread the word


Share your thoughts

For today's 12 Tips of (CommandBox) Christmas we're going to review how to debug a server that don't want to start.  Figuring out why a server won't come up is usually very easy, but some people will waste a lot of time on it if they don't know how to access the logs.  Part of the issue is that the start command fires off an async process to actually start up the server, so you don't get much feedback right there in your console.

Tailing and Following logs

If a server isn't starting, the first thing to run is the server log command. It will show you the console log for that server.

server log

If the log is very large, use the tail command to just see the last few lines of it.

server log | tail
server log | tail lines=100

To get a live stream of the console log from a running server, use the --follow flag and the command will continue streaming new lines to the console until you press Ctrl-C to stop.

server log --follow

Debug Logging

You can get additional information about a server start with the --debug flag. When debug is set, the start command will not exit immediately, but wait for the server to come up and live stream the debugging information and server logs to the console while the server is coming up.

server start --debug

Start server in console mode

You can use the --console flag to the server start command to start a server in the foreground. The console log will be live-streamed to the CLI and the log will continue streaming as long as the server is running. Press Ctrl-C to stop the server and stop streaming the log file.

server start --console
server start --console --debug

Maximum logging! (trace)

You may still really be having issues getting your server to start up correctly due to a setting not getting picked up, rewrites not working, or maybe a jar not loading. You can "drink from the firehose" so to speak by turning on trace level logging. This works best when starting the server via the console so you can watch the logging as it streams past.

server start --trace --console

 

Add Your Comment

Recent Entries

Thanksgiving Day deals: Access Exclusive Discounts Until November 30th!

Thanksgiving Day deals: Access Exclusive Discounts Until November 30th!

Prepare for the Ortus Thanksgiving Day Deals! This is your chance to enhance your development journey with amazing deals catered to everyone—from experienced developers to tech aficionados. Our unique offers are crafted to assist you in reaching your objectives while conserving your budget!

Don't Let These Incredible Offers Slip Away!

Utilize the code THKSGIVING24 at checkout to take advantage of these fantastic discounts before they end...

Cristobal Escobar
Cristobal Escobar
November 04, 2024
BoxLang Newsletter: October 2024

BoxLang Newsletter: October 2024

Welcome to the October edition of the BoxLang Newsletter! **This month has been packed with exciting updates, new features, and enhancements that continue to shape BoxLang into a robust and versatile programming language. In this edition, we highlight the latest beta releases, new integrations, and key features that have been introduced.

Maria Jose Herrera
Maria Jose Herrera
November 04, 2024
BoxLang 1.0.0 Beta 21 Launched

BoxLang 1.0.0 Beta 21 Launched

This release brings another round of powerful tools and refinements to the BoxLang community, making development more dynamic and robust than ever. We’ve added new capabilities for debugging and tracing, expanded context-sensitive controls for thread management, and introduced new methods for fluent attachment handling.

For deeper flexibility, our improvements enhance configurability, streamline session control, and add deeper levels of JSON serialization management. Plus, we’ve squashed a wide range of bugs, enhancing stability across database connections, date handling, and runtime compatibility with CFML.

In addition, CSRF Token functionality is now provided via the bx-csrf module.

Luis Majano
Luis Majano
November 01, 2024