# Class LogViewer

Object
Widget
LogViewer

All Implemented Interfaces:
  `Localized`

public class LogViewer extends Widget
Shows a table of recent log records, optionally filtered to logs related to a specific resource. By default, `LogViewer` does not show any log entry. For viewing logs, one of the two following actions must be done:

- Set `source` to a non-null `Resource` value.
- Set `systemLogs` to `true`.

When a `Resource` value is specified, `LogViewer` shows only some logs that occurred while using that resource, in particular warnings emitted by the resource.

Since:
  1.1

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final ObjectProperty<Resource>`
  `source`
  The data store or resource for which to show log records.
  `final BooleanProperty`
  `systemLogs`
  Whether to show system logs instead of the logs related to a specific resource.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LogViewer()`
  Creates an initially empty viewer of log records.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Region`
  `getView()`
  Returns the control to show in the scene graph.
  `final ReadOnlyBooleanProperty`
  `isEmptyProperty()`
  Whether this viewer has no log record to show.

  ### Methods inherited from class Widget

  `getLocale`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### source

    public final ObjectProperty<Resource> source
    The data store or resource for which to show log records. If this property value is `null`, then the system logs will be shown if `systemLogs` is `true`, or no logs will be shown otherwise.
    See Also:
      - `Resource​.addListener(Class, StoreListener)`

  - ### systemLogs

    public final BooleanProperty systemLogs
    Whether to show system logs instead of the logs related to a specific resource. If this property is set to `true`, then `source` is automatically set to `null`. Conversely if `source` is set to a non-null value, then this property is set to `false`.

- ## Constructor Details

  - ### LogViewer

    public LogViewer()
    Creates an initially empty viewer of log records. For viewing logs, `source` must be set to a non-null value or `systemLogs` must be set to `true`.

- ## Method Details

  - ### isEmptyProperty

    public final ReadOnlyBooleanProperty isEmptyProperty()
    Whether this viewer has no log record to show. This property is useful for disabling or enabling a tab.
    Returns:
      the property telling whether this viewer no log record to show.

  - ### getView

    public Region getView()
    Returns the control to show in the scene graph. The implementation class may change in any future version.
    Specified by:
      `getView` in class `Widget`
    Returns:
      the JavaFX component to insert in a scene graph.