Skip to content

Commit 911f93b

Browse files
committed
Improve documentation, to configure the logfile
1 parent b33c3ee commit 911f93b

1 file changed

Lines changed: 49 additions & 49 deletions

File tree

src/main/webapp/app/admin/logfile/logfile.component.ts

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,64 @@ import { JhiLogfileService } from './logfile.service';
55
import { JhiRoutesService, Route } from 'app/shared';
66

77
@Component({
8-
selector: 'jhi-logfile',
9-
templateUrl: './logfile.component.html',
10-
styleUrls: ['logfile.scss']
8+
selector: 'jhi-logfile',
9+
templateUrl: './logfile.component.html',
10+
styleUrls: ['logfile.scss']
1111
})
1212
export class JhiLogfileComponent implements OnInit, OnDestroy {
13-
activeRoute: Route;
14-
updatingLogfile: boolean;
15-
logtxt: string;
16-
subscription: Subscription;
13+
activeRoute: Route;
14+
updatingLogfile: boolean;
15+
logtxt: string;
16+
subscription: Subscription;
1717

18-
@ViewChild('logfile') private logFileViewer: ElementRef;
18+
@ViewChild('logfile') private logFileViewer: ElementRef;
1919

20-
constructor(private jhiLogfileService: JhiLogfileService, private routesService: JhiRoutesService) {}
20+
constructor(private jhiLogfileService: JhiLogfileService, private routesService: JhiRoutesService) {}
2121

22-
ngOnInit() {
23-
this.subscription = this.routesService.routeChanged$.subscribe((route) => {
24-
this.activeRoute = route;
25-
this.displayActiveRouteLog();
26-
});
27-
}
22+
ngOnInit() {
23+
this.subscription = this.routesService.routeChanged$.subscribe(route => {
24+
this.activeRoute = route;
25+
this.displayActiveRouteLog();
26+
});
27+
}
2828

29-
displayActiveRouteLog() {
30-
this.updatingLogfile = true;
31-
if (this.activeRoute && this.activeRoute.status !== 'DOWN') {
32-
this.jhiLogfileService.getInstanceLogfile(this.activeRoute).subscribe(
33-
(logtxt) => {
34-
this.logtxt = logtxt;
35-
this.updatingLogfile = false;
36-
},
37-
(error) => {
38-
if (error.status === 503 || error.status === 500 || error.status === 404) {
39-
this.logtxt =
40-
'No available logfile. \n' +
41-
'Please check:\n ' +
42-
'- if the microservice is up\n ' +
43-
'- these properties are set: \n ' +
44-
' - logging.path\n ' +
45-
' - logging.file (to avoid using the same spring.log)\n\n' +
46-
'See:\n ' +
47-
'- https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html\n ' +
48-
'- https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html';
49-
this.updatingLogfile = false;
50-
}
51-
}
52-
);
29+
displayActiveRouteLog() {
30+
this.updatingLogfile = true;
31+
if (this.activeRoute && this.activeRoute.status !== 'DOWN') {
32+
this.jhiLogfileService.getInstanceLogfile(this.activeRoute).subscribe(
33+
logtxt => {
34+
this.logtxt = logtxt;
35+
this.updatingLogfile = false;
36+
},
37+
error => {
38+
if (error.status === 503 || error.status === 500 || error.status === 404) {
39+
this.logtxt =
40+
'No available logfile. Please note that it is not available by default, you need to set up the Spring Boot properties below! \n' +
41+
'Please check:\n ' +
42+
'- if the microservice is up\n ' +
43+
'- if these properties are set: \n ' +
44+
' - logging.path\n ' +
45+
' - logging.file (to avoid using the same spring.log)\n\n' +
46+
'See:\n ' +
47+
'- https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html\n ' +
48+
'- https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html';
49+
this.updatingLogfile = false;
50+
}
5351
}
52+
);
5453
}
54+
}
5555

56-
scrollToBottom() {
57-
this.logFileViewer.nativeElement.scrollTop = this.logFileViewer.nativeElement.scrollHeight;
58-
}
56+
scrollToBottom() {
57+
this.logFileViewer.nativeElement.scrollTop = this.logFileViewer.nativeElement.scrollHeight;
58+
}
5959

60-
scrollToTop() {
61-
this.logFileViewer.nativeElement.scrollTop = this.logFileViewer.nativeElement.scrolledUp;
62-
}
60+
scrollToTop() {
61+
this.logFileViewer.nativeElement.scrollTop = this.logFileViewer.nativeElement.scrolledUp;
62+
}
6363

64-
ngOnDestroy() {
65-
// prevent memory leak when component destroyed
66-
this.subscription.unsubscribe();
67-
}
64+
ngOnDestroy() {
65+
// prevent memory leak when component destroyed
66+
this.subscription.unsubscribe();
67+
}
6868
}

0 commit comments

Comments
 (0)