mirror of
https://github.com/strapi/strapi.git
synced 2025-12-30 00:37:24 +00:00
Add ENV to allow hiding startup message (#6348)
* Add ENV to allow hiding startup message Signed-off-by: Peter Baričič <pbaricic@gmail.com> * Rename ENV Signed-off-by: Peter Baričič <peter.baricic@naytrolabs.com> * Revert the logic Signed-off-by: Peter Baričič <pbaricic@gmail.com> * Update docs with startup ENVs Signed-off-by: Peter Baričič <pbaricic@gmail.com> Co-authored-by: Peter Baričič <peter.baricic@naytrolabs.com> Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
This commit is contained in:
parent
eb272e996c
commit
36ab6144cb
@ -61,6 +61,15 @@ Start a Strapi application with autoReload disabled.
|
||||
This commands is there to run a Strapi application without restarts and file writes (aimed at production usage).
|
||||
Certain features are disabled in the `strapi start` mode because they require application restarts.
|
||||
|
||||
Allowed environment variables:
|
||||
| Property | Description | Type | Default |
|
||||
| --------- | ----------- | ----- | ------- |
|
||||
| STRAPI_HIDE_STARTUP_MESSAGE | If `true` then Strapi will not show startup message on boot. Values can be `true` or `false` | string | `false` |
|
||||
| STRAPI_LOG_LEVEL | Values can be 'fatal', 'error', 'warn', 'info', 'debug', 'trace' | string | `debug` |
|
||||
| STRAPI_LOG_TIMESTAMP | Enables or disables the inclusion of a timestamp in the log message. Values can be `true` or `false` | string | `false`|
|
||||
| STRAPI_LOG_FORCE_COLOR | Values can be `true` or `false` | string | `true` |
|
||||
| STRAPI_LOG_PRETTY_PRINT | If pino-pretty module will be used to format logs. Values can be `true` or `false` | string | `true` |
|
||||
|
||||
## strapi build
|
||||
|
||||
Builds your admin panel.
|
||||
|
||||
@ -188,10 +188,17 @@ class Strapi {
|
||||
// Is the project initialised?
|
||||
const isInitialised = await utils.isInitialised(this);
|
||||
|
||||
if (!isInitialised) {
|
||||
this.logFirstStartupMessage();
|
||||
} else {
|
||||
this.logStartupMessage();
|
||||
// Should the startup message be displayed?
|
||||
const hideStartupMessage = process.env.STRAPI_HIDE_STARTUP_MESSAGE
|
||||
? process.env.STRAPI_HIDE_STARTUP_MESSAGE === 'true'
|
||||
: false;
|
||||
|
||||
if (hideStartupMessage === false) {
|
||||
if (!isInitialised) {
|
||||
this.logFirstStartupMessage();
|
||||
} else {
|
||||
this.logStartupMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// Emit started event.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user