Main Content

setLogLevel

Class: matlab.compiler.mlspark.SparkContext
Namespace: matlab.compiler.mlspark

Set log level

Syntax

setLogLevel(sc,logLevel)

Description

setLogLevel(sc,logLevel) sets the log level to one of eight possible options.

Input Arguments

expand all

The SparkContext to use, specified as a SparkContext object.

Log level, specified as one of the following values:

  • 'ALL'

  • 'DEBUG'

  • 'ERROR'

  • 'FATAL'

  • 'INFO'

  • 'OFF'

  • 'TRACE'

  • 'WARN'

Data Types: char | string

Examples

expand all

Set the log level for execution against Spark™.

%% Connect to Spark
sparkProp = containers.Map({'spark.executor.cores'}, {'1'});
conf = matlab.compiler.mlspark.SparkConf('AppName','myApp', ...
                        'Master','local[1]','SparkProperties',sparkProp);
sc = matlab.compiler.mlspark.SparkContext(conf);

%% Set log level
sc.setLogLevel('OFF');

Version History

Introduced in R2016b