samza-log4j/src/main/java/org/apache/samza/config/Log4jSystemConfig.java [31:88]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class Log4jSystemConfig extends SystemConfig {

  private static final String LOCATION_ENABLED = "task.log4j.location.info.enabled";
  private static final String TASK_LOG4J_SYSTEM = "task.log4j.system";

  public Log4jSystemConfig(Config config) {
    super(config);
  }

  /**
   * Defines whether or not to include file location information for Log4J
   * appender messages. File location information includes the method, line
   * number, class, etc.
   *
   * @return If true, will include file location (method, line number, etc)
   *         information in Log4J appender messages.
   */
  public boolean getLocationEnabled() {
    return "true".equals(get(Log4jSystemConfig.LOCATION_ENABLED, "false"));
  }

  /**
   * Get the log4j system name from the config.
   * If it's not defined, throw a ConfigException
   *
   * @return log4j system name
   */
  public String getSystemName() {
    String log4jSystem = get(TASK_LOG4J_SYSTEM, null);
    if (log4jSystem == null) {
      throw new ConfigException("Missing " + TASK_LOG4J_SYSTEM + " configuration. Can't figure out the system name to use.");
    }
    return log4jSystem;
  }

  public String getJobName() {
    return get(JobConfig.JOB_NAME, null);
  }

  public String getJobId() {
    return get(JobConfig.JOB_ID, null);
  }

  /**
   * Get the class name according to the serde name.
   *
   * @param name serde name
   * @return serde factory name, or null if there is no factory defined for the
   *         supplied serde name.
   */
  public String getSerdeClass(String name) {
    return get(String.format(SerializerConfig.SERDE_FACTORY_CLASS, name), null);
  }

  public String getStreamSerdeName(String systemName, String streamName) {
    StreamConfig streamConfig =  new StreamConfig(this);
    Optional<String> option = streamConfig.getStreamMsgSerde(new SystemStream(systemName, streamName));
    return option.isPresent() ? option.get() : null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



samza-log4j2/src/main/java/org/apache/samza/config/Log4jSystemConfig.java [31:88]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class Log4jSystemConfig extends SystemConfig {

  private static final String LOCATION_ENABLED = "task.log4j.location.info.enabled";
  private static final String TASK_LOG4J_SYSTEM = "task.log4j.system";

  public Log4jSystemConfig(Config config) {
    super(config);
  }

  /**
   * Defines whether or not to include file location information for Log4J
   * appender messages. File location information includes the method, line
   * number, class, etc.
   *
   * @return If true, will include file location (method, line number, etc)
   *         information in Log4J appender messages.
   */
  public boolean getLocationEnabled() {
    return "true".equals(get(Log4jSystemConfig.LOCATION_ENABLED, "false"));
  }

  /**
   * Get the log4j system name from the config.
   * If it's not defined, throw a ConfigException
   *
   * @return log4j system name
   */
  public String getSystemName() {
    String log4jSystem = get(TASK_LOG4J_SYSTEM, null);
    if (log4jSystem == null) {
      throw new ConfigException("Missing " + TASK_LOG4J_SYSTEM + " configuration. Can't figure out the system name to use.");
    }
    return log4jSystem;
  }

  public String getJobName() {
    return get(JobConfig.JOB_NAME, null);
  }

  public String getJobId() {
    return get(JobConfig.JOB_ID, null);
  }

  /**
   * Get the class name according to the serde name.
   *
   * @param name serde name
   * @return serde factory name, or null if there is no factory defined for the
   *         supplied serde name.
   */
  public String getSerdeClass(String name) {
    return get(String.format(SerializerConfig.SERDE_FACTORY_CLASS, name), null);
  }

  public String getStreamSerdeName(String systemName, String streamName) {
    StreamConfig streamConfig =  new StreamConfig(this);
    Optional<String> option = streamConfig.getStreamMsgSerde(new SystemStream(systemName, streamName));
    return option.isPresent() ? option.get() : null;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



