mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 09:15:44 +03:00
chore(server): improve log messages (#24744)
* Clarify the "asset not found" log during thumbnail generation: it's about database * Move not found sidecars to verbose level instead of "old=null, new=null" at debug * Log memory creation at default level * Add explicit log for missing exif date time Instead of: Date and time is undefined using exifTag undefined for asset ... * Log database migration start/end at default level Currently, these messages are logged as "debug". But they are not printed when debug or verbose level is set. This is due to the known limitation: SystemConfigService sets LogLevel later on, after migrations run.
This commit is contained in:
@@ -358,7 +358,7 @@ export class DatabaseRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async runMigrations(): Promise<void> {
|
async runMigrations(): Promise<void> {
|
||||||
this.logger.debug('Running migrations');
|
this.logger.log('Running migrations');
|
||||||
|
|
||||||
const migrator = this.createMigrator();
|
const migrator = this.createMigrator();
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ export class DatabaseRepository {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.debug('Finished running migrations');
|
this.logger.log('Finished running migrations');
|
||||||
}
|
}
|
||||||
|
|
||||||
async migrateFilePaths(sourceFolder: string, targetFolder: string): Promise<void> {
|
async migrateFilePaths(sourceFolder: string, targetFolder: string): Promise<void> {
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ export class MediaService extends BaseService {
|
|||||||
async handleGenerateThumbnails({ id }: JobOf<JobName.AssetGenerateThumbnails>): Promise<JobStatus> {
|
async handleGenerateThumbnails({ id }: JobOf<JobName.AssetGenerateThumbnails>): Promise<JobStatus> {
|
||||||
const asset = await this.assetJobRepository.getForGenerateThumbnailJob(id);
|
const asset = await this.assetJobRepository.getForGenerateThumbnailJob(id);
|
||||||
if (!asset) {
|
if (!asset) {
|
||||||
this.logger.warn(`Thumbnail generation failed for asset ${id}: not found`);
|
this.logger.warn(`Thumbnail generation failed for asset ${id}: not found in database or missing metadata`);
|
||||||
return JobStatus.Failed;
|
return JobStatus.Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export class MemoryService extends BaseService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.logger.log(`Creating memories for ${target.toISO()}`);
|
||||||
try {
|
try {
|
||||||
await Promise.all(users.map((owner) => this.createOnThisDayMemories(owner.id, target)));
|
await Promise.all(users.map((owner) => this.createOnThisDayMemories(owner.id, target)));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -366,9 +366,13 @@ export class MetadataService extends BaseService {
|
|||||||
|
|
||||||
const isChanged = sidecarPath !== sidecarFile?.path;
|
const isChanged = sidecarPath !== sidecarFile?.path;
|
||||||
|
|
||||||
this.logger.debug(
|
if (sidecarFile?.path || sidecarPath) {
|
||||||
`Sidecar check found old=${sidecarFile?.path}, new=${sidecarPath} will ${isChanged ? 'update' : 'do nothing for'} asset ${asset.id}: ${asset.originalPath}`,
|
this.logger.debug(
|
||||||
);
|
`Sidecar check found old=${sidecarFile?.path}, new=${sidecarPath} will ${isChanged ? 'update' : 'do nothing for'} asset ${asset.id}: ${asset.originalPath}`,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.logger.verbose(`No sidecars found for asset ${asset.id}: ${asset.originalPath}`);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isChanged) {
|
if (!isChanged) {
|
||||||
return JobStatus.Skipped;
|
return JobStatus.Skipped;
|
||||||
@@ -858,9 +862,13 @@ export class MetadataService extends BaseService {
|
|||||||
const result = firstDateTime(exifTags);
|
const result = firstDateTime(exifTags);
|
||||||
const tag = result?.tag;
|
const tag = result?.tag;
|
||||||
const dateTime = result?.dateTime;
|
const dateTime = result?.dateTime;
|
||||||
this.logger.verbose(
|
if (dateTime) {
|
||||||
`Date and time is ${dateTime} using exifTag ${tag} for asset ${asset.id}: ${asset.originalPath}`,
|
this.logger.verbose(
|
||||||
);
|
`Date and time is ${dateTime} using exifTag ${tag} for asset ${asset.id}: ${asset.originalPath}`,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.logger.verbose(`No exif date time information found for asset ${asset.id}: ${asset.originalPath}`);
|
||||||
|
}
|
||||||
|
|
||||||
// timezone
|
// timezone
|
||||||
let timeZone = exifTags.tz ?? null;
|
let timeZone = exifTags.tz ?? null;
|
||||||
|
|||||||
Reference in New Issue
Block a user