애플리케이션을 구성하여 ElasticSearch에 모든 유형의 로그를 작성할 수 있습니다.
첫 번째 단계로 Visual Studio에서 빈 웹 애플리케이션(.net core)을 생성해야 합니다.
이제 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 선택하십시오. ** 새 항목 추가** 및 검색 구성 찾다 웹 구성 파일 옵션. 세트 nlog.config 파일 이름으로.
누메라이 헤지펀드에 투자하는 방법
1
2
삼
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
4
autoReload='true'>
5
6
7
8
9
10
열하나
philo.com/roku 활성화
12
xsi:type='ElasticSearch'
13
uri='http://192.168.50.60:9200'
14
layout ='API:SpecificName |${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}' >
열 다섯
16
17
18
19
스물
25
26
27
28
29
로깅 구성을 설정하기 전에 몇 가지 관련 패키지를 설치해야 합니다. 이를 위해 도구 메뉴에서 NugetPackageManager를 선택한 다음 PackageManagerConsole을 선택합니다. 애플리케이션을 구성하여 ElasticSearch에 모든 유형의 로그를 작성할 수 있습니다.
첫 번째 단계로 Visual Studio에서 빈 웹 애플리케이션(.net core)을 생성해야 합니다.
이제 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 새 항목 추가를 선택하고 구성을 검색하여 웹 구성 파일 옵션을 찾습니다. nlog.config를 파일 이름으로 설정합니다.
새로 추가된 구성 파일에 아래 코드를 작성합니다.
XML
1
재료 UI 아이콘 색상
2
http://www.nlog-project.org/schemas/NLog.xsd
삼
xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance
4
autoReload=참>
5
6
7
8
9
10
열하나
12
xsi:type=ElasticSearch
13
index=귀하의 앱 이름 URI= http://192.168.50.60:9200
14
레이아웃 =API:SpecificName |${longdate}|${event-properties:item=EventId_Id}|${대문자:${level}}|${logger}|${message} ${exception:format=tostring}| URL: ${aspnet-request-url}|액션: ${aspnet-mvc-action} >
열 다섯
16
17
18
19
스물
이십 일
22
2. 3
24
->
25
26
27
28
29
Before set the logging config, we should install some related packages, For this purpose, select NugetPackageManager from Tools menu and after that select PackageManagerConsole.
#프로그래밍 #elasticsearch #nlog # .net 코어 # .net #elasticsearch
dzone.com
NLog를 사용하여 .Net Core 애플리케이션의 로그를 ElasticSearch에 쓰기
NLog를 사용하여 .et 코어 애플리케이션의 로그를 ElasticSearch에 쓰는 방법.