Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better logging for stacks integration #51

Open
jkeck opened this issue Apr 10, 2020 · 0 comments
Open

Add better logging for stacks integration #51

jkeck opened this issue Apr 10, 2020 · 0 comments

Comments

@jkeck
Copy link
Contributor

jkeck commented Apr 10, 2020

Part of sul-dlss/media#155

We currently have logging in places when we reject sessions due to invalid configurations (and other reasons), but since we're seeing sessions getting rejected that should be accepted (and then are accepted later w/o intervention) it would be helpful to be able to determine why the sessions are being rejected in these cases.

rejectSession() already outputs a generic line in the log (along the lines of HTTPStreamerAdapterCupertinoStreamer.onPlaylist[stacks/_definst_....]: Session not accepted) so we should be able to add some addl. context that we can use to determine what's going on (w/o blowing the logs up).

if (validateStacksToken(stacksToken) && validateUserIp(userIp) && validateStreamName(streamName))
{
String druid = getDruid(streamName);
String filename = getFilename(streamName);
if (druid != null && filename != null && verifyStacksToken(stacksToken, druid, filename, userIp))
httpSession.acceptSession();
else
httpSession.rejectSession();
}
else
httpSession.rejectSession();

If we can add the reason that the if/else statements fall through to the session being rejected that could give us some insight into the issues we're seeing.

There are also additional unlogged cases (e.g. if the HTTP request to Stacks is unsuccessful) that might also be at play (and may be worth throwing some sort of logging/HB reporting).

if (status == HttpURLConnection.HTTP_OK)
return true;
else
return false;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant