////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
[[LoggingBasics]]
:imagesdir: ../assets/images/logging
:description: Every workflow or pipeline you execute through Hop Gui or Hop Run and a lot of the other tools generate logging as logging text in the most obvious form.

= Logging

Every workflow or pipeline you execute through Hop Gui or Hop Run and a lot of the other tools generate logging as logging text in the most obvious form.

Hop allows data developers to influence how, where and at which level of detail logging information is generated and where it is written to.

== Levels

=== Descriptions

The amount of text logging generated depends on the logging level which is used when executing a workflow or pipeline:

|===
|Level |Description

|NOTHING
|No logging is generated

|ERROR
|Only errors are reported

|MINIMAL
|The bare essential, nothing more

|BASIC
|The standard logging which tries to be concise and informative

|DETAILED
|More logging information about what happens behind the scenes is reported

|DEBUG
|A lot of information is produced, often with specific values being reported

|ROWLEVEL
|Values are reported on an individual row level

|===

=== Runtime levels

The logging level can be specified when executing using hop-run or in the Hop GUI.
It is also possible to use the debug plugin to set custom logging levels on a transform:

image::logging/custom-logging-actions.png[Transform action - show logging options,35%,align="left"]

You can set a custom logging level for this particular transform and only for certain rows of data:

image::logging/custom-transform-logging-level.png[Setting a custom transform logging level,60%,align="left"]

You can do likewise for a workflow:

image::logging/custom-action-logging-level.png[Setting a custom action logging level,35%,align="left"]

== Hop GUI logging

The logging file of the Hop GUI is saved in the `audit/` folder (or in the folder set by `HOP_AUDIT_FOLDER`) in the `hopui.log` file.

== Tools logging

If you want to send logging of tools like hop-run or hop-conf to a logging file you need to do this simply by piping the text stream to a file.

== Logging plugins 

=== Actions 

==== Write to log 

The Write to log acction writes a specific string to the Hop logging system.

Check the xref:../workflow/actions/writetolog.adoc[Write To Log] page for more details.

=== Metadata Types

==== Pipeline Log 

A pipeline log allows to log the activity of a pipeline with another pipeline.

Check the xref:../metadata-types/pipeline-log.adoc[pipeline log] and xref:../logging/logging-reflection.adoc[logging reflection] pages for more details.

==== Workflow Log

Allows to log the activity of a workflow with a pipeline.

Check the xref:../metadata-types/workflow-log.adoc[workflow log] and xref:../logging/logging-reflection.adoc[logging reflection] pages for more details.

=== Perspectives 

==== Neo4j 

Hop can write execution logs for workflows and pipelines to a Neo4j database.

Check xref:../hop-gui/perspective-neo4j.adoc[Neo4j Perspective] page for more details.

=== Transforms 

==== Write to Log

This transform writes information to the Hop logging system.

Check the xref:../pipeline/transforms/writetolog.adoc[Write To Log] page for more details.