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

Logs - Implementing the ability to Download Logs #325

Merged
merged 33 commits into from
Dec 12, 2019

Conversation

hwong0305
Copy link
Collaborator

@hwong0305 hwong0305 commented Dec 11, 2019

#288

  • Updated code to have pm2 output logs into a specific location and filename for each app.
  • implementing API to get error and output logs from the server
  • Added test for API

Logs Screenshot

@hwong0305 hwong0305 changed the base branch from master to Refactoring December 11, 2019 10:40
@hwong0305 hwong0305 changed the base branch from Refactoring to master December 11, 2019 10:41
src/api/logs.ts Outdated
const { domain } = req.params
const { fullDomain } = getMappingByDomain(domain)

if (!isProduction()) return res.send('OK')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not get the logs in dev? I don't have context but, a comment in the code might be nice for future devs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the codebase to allow for access of logs in dev. From the current codebase with c0d3.com, the proxy server will not run when running in dev. The user will have to navigate to the port on the server to access their apps.

Copy link
Collaborator

@songz songz Dec 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshgreenwell Thanks for the comment! My thoughts to give you some perspective: logs are directly tied to root pm2, so one should be running in production flag when testing these to simulate production as much as possible, especially when these functionalities (ssl certs, logs, etc) are so low level.

At this point I don't see any need other than prod vs non-prod.

Usually test vs stage vs sandbox environment comes into importance when you start dealing with databases and billing.

@joshgreenwell
Copy link
Contributor

Can you add a screenshot to the PR description? I'm curious about what this feature looks like on the UI.

@hwong0305
Copy link
Collaborator Author

Updated PR description to include screenshot of the feature

@@ -5,5 +5,6 @@ export default {
HOME: process.env.HOME || process.env.ENV || null,
WORKPATH: process.env.WORKPATH || '/home/myproxy',
isProduction: (): boolean =>
(process.env.NODE_ENV || process.env.ENV) === 'production'
(process.env.NODE_ENV || process.env.ENV) === 'production',
isTest: (): boolean => (process.env.NODE_ENV || process.env.ENV) === 'test'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means that during development, we have to run this with test now? I don't think devs are ready for that yet. Could we use production flag?

}
if (target === 'mappings') {
return fetch(`${apiURL}/api/mappings${path}`, options)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove lines 25-27

@songz songz merged commit e790ba7 into garageScript:master Dec 12, 2019
@hwong0305 hwong0305 deleted the logs branch December 12, 2019 17:28
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

Successfully merging this pull request may close these issues.

None yet

5 participants