////
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.
////
:documentationPath: /workflow/actions/
:language: en_US
:description: The Write To Log action writes a specific string to the Hop logging system.
:openvar: ${
:closevar: }

= Write to Log

== Description

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

This action is similar to the xref:pipeline/transforms/writetolog.adoc[Write To Log] transform.

Typical use cases are logging variable values and additional, custom logging information to the Hop logging system.

TIP: be careful when writing variables for (unencrypted) passwords or other sensitive information to the Hop logging system!

If no fields are specified it will write out all fields to the log. If at least one field is specified it will only print out that field. Parameters and variables must be specified in the Log message section.  

A Logging level must be set. Set the Log detail level to Basic if you want parameters and variables to be printed out.

Example to print parameter or variable in Log message section: ``COUNTER: {openvar}COUNTER{closevar}``

If no fields exist, you will have to use a “Generate rows” transform to create a dummy row in order to print variables or parameters.

TIP: If an error stops anything from being written to the log, then disable the Hops that fail, add logging, and re-run.


== Options

[options="header", width="90%", cols="1,3"]
|===
|Option|Description
|Action name|The name of the workflow action.
|Log level|The logging level to use.  See xref:logging/logging-basics.adoc[Logging] for more details.
|Log subject|The subject to use in the logging line(s)
|Log message|The log message to write to the log
|===
