This repository has been archived by the owner on Jan 9, 2020. It is now read-only.
forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 118
Docker logging handler #576
Open
echarles
wants to merge
13
commits into
apache-spark-on-k8s:branch-2.2-kubernetes
Choose a base branch
from
datalayer-externals:docker-logging-handler
base: branch-2.2-kubernetes
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
118f587
add custom docker logging handler
echarles fdd9b5c
Add log on image build
echarles 6c8851c
use println instead of log
echarles 21f5223
Merge branch 'branch-2.2-kubernetes' into docker-logging-handler
echarles 9ab9b02
use slf4j to log
echarles fec57fc
tune log4j to display log message on the console
echarles a55d8b2
use custom LoggingBuildHandler
echarles 25cd876
Merge branch 'branch-2.2-kubernetes' into docker-logging-handler
echarles 742520a
use log instead of println
echarles ea3d942
Merge branch 'branch-2.2-kubernetes' into docker-logging-handler
echarles 7451bf6
Merge branch 'docker-logging-handler' of https://github.com/datalayer…
echarles 5ee6eaa
remove logging to console
echarles 3307860
use the Logging trait instead of plain log4j
echarles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...ntegration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/Logging.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* 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. | ||
*/ | ||
package org.apache.spark.deploy.k8s.integrationtest | ||
|
||
import org.apache.log4j.{Logger, LogManager, Priority} | ||
|
||
trait Logging { | ||
|
||
private val log: Logger = LogManager.getLogger(this.getClass) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Spark already has something similiar in core? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, I have seen that also. Does it make sense to follow up with this PR and the apache repo? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If possible let's reuse what Spark has, the same question will arise when we try to merge back to Spark as well. |
||
|
||
protected def logDebug(msg: => String) = if (log.isDebugEnabled) log.debug(msg) | ||
|
||
protected def logInfo(msg: => String) = if (log.isInfoEnabled) log.info(msg) | ||
|
||
protected def logWarning(msg: => String) = if (log.isEnabledFor(Priority.WARN)) log.warn(msg) | ||
|
||
protected def logWarning(msg: => String, throwable: Throwable) = | ||
if (log.isEnabledFor(Priority.WARN)) log.warn(msg, throwable) | ||
|
||
protected def logError(msg: => String) = if (log.isEnabledFor(Priority.ERROR)) log.error(msg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure we want console here. On the upside, I understand most people actually do not know they can check target/integration-tests.log. On the downside, too many log messages could get people lost.
Anyone has a strong opinion on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping! @echarles or anyone else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, I am good with this PR pending this question being resolved. Maybe we just want to remove console output part and move on so the PR can be merged?