- Index

< Previous |  | Next >

# LiveView Server System Configuration

LiveView has several customizations for logging, port usage, and authentication.

## Project-Specific Configuration Files

To manage LiveView Server configuration settings, place a LiveView engine configuration file of HOCON type in the `src/main/configurations` directory at the root of your Studio project directory and place your settings there. The Live Datamart engine configuration inherits from the EventFlow engine configuration, which in turn inherits from the base Java engine. See Runtime JavaEngine Configuration for a list of available Java engine options.

## System Logging Overview

For all supported operating systems, StreamBase uses the industry-standard SLF4J logging system with the Logback framework. See Windows Event Logging for additional considerations for Windows.

All subsystems in EventFlow and LiveView fragments use Logback logging. You can configure the level of logging information emitted, and can direct logs to different appenders using standard Logback configuration files in either XML or Groovy formats.

Log files are written by default into a subdirectory named `logs` in a fragment's node directory:

- For fragments run in StreamBase Studio, the node directory is removed on Studio exit for all successful fragment launches. If a launch fails, its node directory is preserved so that you can inspect log files.

- For fragment launches made from the command line, you specify the location of each fragment's node directory as part of the epadmin node install command. In this case, the node directory and its `logs` subdirectory is preserved in the location you specify.

See Using StreamBase Logging for more information regarding logging.

## Setting LiveView JVM Heap Memory

When launching a LiveView application from the command line or from StreamBase Studio, you might receive warnings such as:

    MemoryConfigTooLow - Maximum heap size configured to be 3,204 MB,
    which is below recommended size for LiveView production configurations

To avoid such warnings, you can increase the maximum JVM heap size for the current LiveView project. Do this the same way for LiveView projects by setting `Xmx` and `Xms` values in the `jvmArgs` property of the LiveView Engine configuration file for your LiveView project. For a JVM heap memory example, see the Hello LiveView sample's `engine.conf` file, located in `src/main/configurations`.

Use settings like the following:

    jvmArgs = [
      "-Xmx1024m"
      "-Xms512m"
    ]

See Java VM Memory Settings for further details.

## Setting StreamBase and LiveView Ports

A running LiveView instance uses two ports. Each LiveView instance requires two TCP ports: one for server processes (StreamBase port) and one for client connections (LiveView port). By default, these port numbers are 10000 and 10080, respectively. When you start a LiveView project, both ports are in use. Set the port numbers in one of the following ways for a server process:

1. For the StreamBase port, set the `portNumber` property for an EventFlow Client API Listener configuration file of HOCON type:

       portNumber = 10000

2. For the LiveView port, set the `portNumber` property for an LiveView Client API Listener configuration file of HOCON type:

       portNumber = 10080

3. Use the EventFlow Engine configuration file of HOCON type to set a `systemProperties` property for the `tcp-port` parameter:

       systemProperties = { "tcp-port" = "new-port-value"}

4. Use the LiveView Engine configuration file of HOCON type to set a `systemProperties` property for the `liveview.port` parameter:

       systemProperties = {"liveview.port" value= "different-new-port-value"}

   If you are running from StreamBase Studio, edit the ports as follows:

   1. Right-click on a project folder, or on any of the lvconf files for a project, and select Run As → Run Configurations.

   2. Select LiveView Fragment and click the New Launch Configuration icon in the upper left corner.

   3. In the Options pane, select a LiveView project and set the port numbers.

   4. Click Run.

## Configuring the Location of Generated Files and Metadata

By default, when you run a LiveView project, LiveView creates an lv-bin directory for generated project files and an lv-systemdata directory for generated project data. (These directories are hidden by default; you can change the default view with the Project Explorer filters.) You can add a system property (`liveview.project.out`) to the project's LiveView Engine configuration file that defines a writable folder for files and metadata that LiveView Server generates. For example:

    systemProperties = { "liveview.project.out" = "..\out"}

The value of this property can be an absolute or relative path. If it is a relative path, it is appended to the liveview.project.home. If the specified folder is not writable, LiveView throws an exception. LiveView Server redirects all generated files and metadata to this path.

The lv-bin folder is written under the specified folder (for example, `..\out\lv-bin`). If this property is not specified, the output folder is assumed to be the project home (lv-bin is then created in `\project_home\lv-bin`.) If the project_home folder is not writable, the compiler first tries the user's folder and then tries the temp folder. This information is logged. If LiveView cannot find a writable folder, it throws an exception.

If you only set `liveview.project.out`, LiveView writes lv-bin and lv-systemdata to the lv.project.out directory.

If you set both `liveview.project.out` and `liveview.systemdata.directory` system properties, lv-bin goes into lv.project.out and lv-systemdata goes in lv.systemdata.directory.

If you set only `liveview.systemdata.directory`, lv-bin goes in the project workspace and lv-systemdata goes in lv.systemdata.directory.