Skip to content

Commit

Permalink
rework logging for articles and include DCAR consideration
Browse files Browse the repository at this point in the history
  • Loading branch information
cemms1 committed Oct 11, 2023
1 parent 1b8ee66 commit 0753ec7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
1 change: 0 additions & 1 deletion article/app/controllers/ArticleController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class ArticleController(
case HtmlFormat | AmpFormat =>
Future.successful(common.renderHtml(ArticleHtmlPage.html(article), article))
case AppsFormat =>
log.info("[ArticleRendering] path executing in dotcom rendering for apps (DCAR)")
remoteRenderer.getAppsArticle(
ws,
article,
Expand Down
26 changes: 23 additions & 3 deletions article/app/services/dotcomrendering/ArticlePicker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import implicits.Requests._
import model.{ArticlePage, PageWithStoryPackage}
import play.api.mvc.RequestHeader
import utils.DotcomponentsLogger
import implicits.AppsFormat

object ArticlePageChecks {

Expand Down Expand Up @@ -65,11 +66,30 @@ object ArticlePicker {
("pageTones" -> pageTones)

if (tier == RemoteRender) {
DotcomponentsLogger.logger.logRequest(s"path executing in dotcomponents", features, page.article)
if (request.getRequestFormat == AppsFormat)
DotcomponentsLogger.logger.logRequest(
s"[ArticleRendering] path executing in dotcom rendering for apps (DCAR)",
features,
page.article,
)
else
DotcomponentsLogger.logger.logRequest(
s"[ArticleRendering] path executing in dotcomponents",
features,
page.article,
)
} else if (tier == PressedArticle) {
DotcomponentsLogger.logger.logRequest(s"path executing from pressed content", features, page.article)
DotcomponentsLogger.logger.logRequest(
s"[ArticleRendering] path executing from pressed content",
features,
page.article,
)
} else {
DotcomponentsLogger.logger.logRequest(s"path executing in web", features, page.article)
DotcomponentsLogger.logger.logRequest(
s"[ArticleRendering] path executing in web (frontend)",
features,
page.article,
)
}

tier
Expand Down

0 comments on commit 0753ec7

Please sign in to comment.