Skip to content

How to output renderer log to custom filePath #410

@heelaine

Description

@heelaine

i suppose to output the log in the renderer to a custom file, attempting to use IPC channel, but the log is being output to the main.log file. How can I customize the log file path in the rendering process?
// main.ts
import log from 'electron/main'
log.initialize({spyRenderedConsole:true})
log.transports.file.resolvePathFn = ()=>{ return join(path,'main.log')}

// renderer.ts
ipcRenderer.send('ELECTRON_LOG',{
data: 'test',
level:'info',
})

if i create logger instances,how to assign renderer instances to output log file path?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions