mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 03:38:26 -07:00
New: Configure log file size limit in UI
(cherry picked from commit 35baebaf7280749d5dfe5440e28b425e45a22d21) Closes #5023
This commit is contained in:
parent
e60a219671
commit
281bcb28fe
5 changed files with 29 additions and 1 deletions
|
@ -156,6 +156,7 @@ class GeneralSettings extends Component {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LoggingSettings
|
<LoggingSettings
|
||||||
|
advancedSettings={advancedSettings}
|
||||||
settings={settings}
|
settings={settings}
|
||||||
onInputChange={onInputChange}
|
onInputChange={onInputChange}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -15,12 +15,14 @@ const logLevelOptions = [
|
||||||
|
|
||||||
function LoggingSettings(props) {
|
function LoggingSettings(props) {
|
||||||
const {
|
const {
|
||||||
|
advancedSettings,
|
||||||
settings,
|
settings,
|
||||||
onInputChange
|
onInputChange
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
logLevel
|
logLevel,
|
||||||
|
logSizeLimit
|
||||||
} = settings;
|
} = settings;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -39,11 +41,30 @@ function LoggingSettings(props) {
|
||||||
{...logLevel}
|
{...logLevel}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
<FormGroup
|
||||||
|
advancedSettings={advancedSettings}
|
||||||
|
isAdvanced={true}
|
||||||
|
>
|
||||||
|
<FormLabel>{translate('LogSizeLimit')}</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.NUMBER}
|
||||||
|
name="logSizeLimit"
|
||||||
|
min={1}
|
||||||
|
max={10}
|
||||||
|
unit="MB"
|
||||||
|
helpText={translate('LogSizeLimitHelpText')}
|
||||||
|
onChange={onInputChange}
|
||||||
|
{...logSizeLimit}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
</FieldSet>
|
</FieldSet>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoggingSettings.propTypes = {
|
LoggingSettings.propTypes = {
|
||||||
|
advancedSettings: PropTypes.bool.isRequired,
|
||||||
settings: PropTypes.object.isRequired,
|
settings: PropTypes.object.isRequired,
|
||||||
onInputChange: PropTypes.func.isRequired
|
onInputChange: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,6 +61,8 @@ namespace Lidarr.Api.V1.Config
|
||||||
.Must((resource, path) => IsValidSslCertificate(resource)).WithMessage("Invalid SSL certificate file or password")
|
.Must((resource, path) => IsValidSslCertificate(resource)).WithMessage("Invalid SSL certificate file or password")
|
||||||
.When(c => c.EnableSsl);
|
.When(c => c.EnableSsl);
|
||||||
|
|
||||||
|
SharedValidator.RuleFor(c => c.LogSizeLimit).InclusiveBetween(1, 10);
|
||||||
|
|
||||||
SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default");
|
SharedValidator.RuleFor(c => c.Branch).NotEmpty().WithMessage("Branch name is required, 'master' is the default");
|
||||||
SharedValidator.RuleFor(c => c.UpdateScriptPath).IsValidPath().When(c => c.UpdateMechanism == UpdateMechanism.Script);
|
SharedValidator.RuleFor(c => c.UpdateScriptPath).IsValidPath().When(c => c.UpdateMechanism == UpdateMechanism.Script);
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace Lidarr.Api.V1.Config
|
||||||
public string Password { get; set; }
|
public string Password { get; set; }
|
||||||
public string PasswordConfirmation { get; set; }
|
public string PasswordConfirmation { get; set; }
|
||||||
public string LogLevel { get; set; }
|
public string LogLevel { get; set; }
|
||||||
|
public int LogSizeLimit { get; set; }
|
||||||
public string ConsoleLogLevel { get; set; }
|
public string ConsoleLogLevel { get; set; }
|
||||||
public string Branch { get; set; }
|
public string Branch { get; set; }
|
||||||
public string ApiKey { get; set; }
|
public string ApiKey { get; set; }
|
||||||
|
@ -65,6 +66,7 @@ namespace Lidarr.Api.V1.Config
|
||||||
// Username
|
// Username
|
||||||
// Password
|
// Password
|
||||||
LogLevel = model.LogLevel,
|
LogLevel = model.LogLevel,
|
||||||
|
LogSizeLimit = model.LogSizeLimit,
|
||||||
ConsoleLogLevel = model.ConsoleLogLevel,
|
ConsoleLogLevel = model.ConsoleLogLevel,
|
||||||
Branch = model.Branch,
|
Branch = model.Branch,
|
||||||
ApiKey = model.ApiKey,
|
ApiKey = model.ApiKey,
|
||||||
|
|
|
@ -666,6 +666,8 @@
|
||||||
"LogFiles": "Log Files",
|
"LogFiles": "Log Files",
|
||||||
"LogLevel": "Log Level",
|
"LogLevel": "Log Level",
|
||||||
"LogLevelvalueTraceTraceLoggingShouldOnlyBeEnabledTemporarily": "Trace logging should only be enabled temporarily",
|
"LogLevelvalueTraceTraceLoggingShouldOnlyBeEnabledTemporarily": "Trace logging should only be enabled temporarily",
|
||||||
|
"LogSizeLimit": "Log Size Limit",
|
||||||
|
"LogSizeLimitHelpText": "Maximum log file size in MB before archiving. Default is 1MB.",
|
||||||
"Logging": "Logging",
|
"Logging": "Logging",
|
||||||
"Logout": "Logout",
|
"Logout": "Logout",
|
||||||
"Logs": "Logs",
|
"Logs": "Logs",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue