-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
Update UI to add links for downloading logs
src/api/logs.ts
Outdated
const { domain } = req.params | ||
const { fullDomain } = getMappingByDomain(domain) | ||
|
||
if (!isProduction()) return res.send('OK') |
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.
Why not get the logs in dev? I don't have context but, a comment in the code might be nice for future devs.
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 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.
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.
@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.
Can you add a screenshot to the PR description? I'm curious about what this feature looks like on the UI. |
Updated PR description to include screenshot of the feature |
src/helpers/environment.ts
Outdated
@@ -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' |
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.
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?
src/tests/helpers/logAdapter.ts
Outdated
} | ||
if (target === 'mappings') { | ||
return fetch(`${apiURL}/api/mappings${path}`, options) | ||
} |
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.
remove lines 25-27
… bug in logs endpoint which searches for a domain during test instance
#288