Contenido principal

setLogLevel

R2026b

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

(To be removed) Set log level

matlab.compiler.mlspark.SparkContext.setLogLevel will be removed in a future release. There is no replacement functionality. For more information, see Version History.

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

collapse all