Running a server in development mode provides enhanced logging and enables some features and behavior useful in development and troubleshooting. Do not run your production server in development mode. Some devmode features reduce performance or make other tradeoffs that make them inappropriate for general usage on production servers.

Developer Features

Features enabled in development mode include (but are not limited to):

  • Logging is enhanced, providing more verbose output from some areas.
  • The "debug" versions of ExtJS and other JavaScript libraries are downloaded and used.
  • The server prevents the browser from caching resources like JavaScript and CSS files as aggressively.
  • The MiniProfiler is enabled.
  • Module Editing is enabled. Note that the server must also have access to the source path for module editing to work. You can tell if your server can access the source for a module by viewing the Module Information on the admin console. Expand the module of interest and if the Source Path is inaccessible, it will be shown in red.
  • Performance may be slower due to the additional logging and lack of caching.
  • Validation of XML is performed which may uncover badly formed XML files, such as those with elements in the wrong order.
  • A variety of test options that aren't appropriate for production use will be available. A few examples:
    • An "expire passwords every five seconds" option for testing the user password reset experience.
    • An insecure "TestSSO" authentication provider.
    • The ability to test ETL filter strategies with a Set Range option.

Run Server in Development Mode

Do not run your production server in development mode, but you might set up a shared development server to support future work, or have each developer work on their own local dev machine.

To check whether the server is running in devmode:

  • Go to (Admin) > Site > Admin Console.
  • On the Server Information tab, scroll to the Runtime Information section.
  • Check the Mode value.

Set -Ddevmode=true

If you are using a local development machine, include the following in your VM options as part of your IntelliJ configuration:

-Ddevmode=true

If you are not using a development machine, you can enable devmode in the service file:

  • On Linux, add to the JAVA_PRE_JAR_OPS in your labkey_server.service file:
    Environment="JAVA_PRE_JAR_OPS=-Duser.timezone=America/Los_Angeles -Ddevmode=true ...<rest of options for this line>..."
  • On Windows, add it to the semicolon separated set of JvmOptions in the install_service.bat file:
    --JvmOptions "-Djava.io.tmpdir=%LABKEY_HOME%\labkey-tmp;-Ddevmode=true;-ea;...<rest of options for this line>..."

Enable Asserts with -ea

You can optionally enable Java asserts by including a separate parameter in the same place where you enabled devmode:
-ea

JVM Caching

Note that the "caching" JVM system property can also be used to control just the caching behavior, without all of the other devmode behaviors. To disallow the normal caching, perhaps because files are being updated directly on the file system, add to the same place where you enabled devmode:

-Dcaching=false

Turn Off Devmode

To turn off devmode:

  1. First stop your server.
  2. Locate the -Ddevmode=true flag whereever it is being set. The location of this setting may vary depending on your version and how it was deployed, but it is generally set with JVM options.
  3. Remove the flag. You do not set it to be false, simply remove it from the startup options.
  4. Restart your server.
  5. Confirm that the Mode is now "Production" in the Runtime Information section of the Admin Console.

Related Topics

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand allcollapse all