feat:整理博客目录结构
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: Docker简介和安装
|
||||
date: 2025-12-15
|
||||
isGreat: true
|
||||
---
|
||||
|
||||
# 一、Docker简介
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: OpenObserve部署和使用
|
||||
date: 2025-11-26
|
||||
isGreat: true
|
||||
---
|
||||
|
||||
# 一、基础概念
|
||||
@@ -551,6 +552,40 @@ public class FluentBitLogger : MonoBehaviour
|
||||
docker-compose文件中也要增加9880端口映射。
|
||||
:::
|
||||
|
||||
## 3.5 Vue
|
||||
  发送HTTP数据到FluentBit中:
|
||||
```ts
|
||||
export const sendError = (err, instance, info) => {
|
||||
try {
|
||||
const log = {
|
||||
top: 'vue-ui',
|
||||
level: 'ERROR',
|
||||
info,
|
||||
component: instance?.$options?.name || 'Anonymous',
|
||||
message: err.message,
|
||||
url: location.href
|
||||
}
|
||||
|
||||
fetch('http://ip:9880', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(log)
|
||||
})
|
||||
} catch {
|
||||
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
  利用app.config.errorHandler监听异常:
|
||||
```ts
|
||||
app.config.errorHandler = (err, instance, info) => {
|
||||
sendError(err, instance, info)
|
||||
}
|
||||
```
|
||||
|
||||
# 四、简单使用
|
||||
## 3.1 配置数据流
|
||||
  打开控制台,选择数据流->添加数据流,输入fluent bit配置文件中的流名称,选择数据流类型为Logs。
|
||||
|
||||
Reference in New Issue
Block a user